1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef __clitkPointListWriter_txx
19 #define __clitkPointListWriter_txx
20 #include "clitkPointListWriter.h"
25 template<unsigned int Dimension>
26 PointListWriter< Dimension >
32 template<unsigned int Dimension>
34 PointListWriter< Dimension >
35 ::Write(const PointListType& list, const std::string& filename )
38 openFileForWriting(os, filename);
40 for (unsigned int pointIndex=0; pointIndex<list.size(); pointIndex++)
42 os << list[pointIndex][0];
43 for (unsigned int dim=1; dim<Dimension; dim++)
44 os <<"\t"<< list[pointIndex][dim];
50 template<unsigned int Dimension>
52 PointListWriter< Dimension >
53 ::Write(const DisplacementListType& list, const std::string& filename )
56 openFileForWriting(os, filename);
58 for (unsigned int pointIndex=0; pointIndex<list.size(); pointIndex++)
60 os << list[pointIndex][0];
61 for (unsigned int dim=1; dim<Dimension; dim++)
62 os <<"\t"<< list[pointIndex][dim];
68 template<unsigned int Dimension>
70 PointListWriter< Dimension >
71 ::Write(const PointListsType& lists, char** filename)
73 for (unsigned int number =0; number<lists.size(); number++)
74 Write(lists[number],filename[number]);
78 template<unsigned int Dimension>
80 PointListWriter< Dimension >
81 ::Write(const DisplacementListsType& lists, char** filename)
83 for (unsigned int number =0; number<lists.size(); number++)
84 Write(lists[number],filename[number]);
90 #endif // PointListWriter