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 ===========================================================================**/
19 /* =================================================
20 * @file clitkConvertPointList.cxx
26 ===================================================*/
30 #include "clitkConvertPointList_ggo.h"
32 #include "clitkImageCommon.h"
33 #include "clitkList.h"
34 #include "clitkLists.h"
37 //--------------------------------------------------------------------
38 int main(int argc, char * argv[]) {
41 GGO(clitkConvertPointList, args_info);
45 typedef itk::Point<double, 3> PointType;
46 typedef clitk::List<PointType> ListType;
47 typedef clitk::Lists<PointType> ListsType;
49 ListsType targetLists;
52 typedef itk::Image<signed short, 3> ImageType;
53 ImageType::Pointer referenceImage=clitk::readImage<ImageType>(args_info.refIm_arg, args_info.verbose_flag);
56 std::vector< std::string> fileNames;
57 for(unsigned int i=0; i< args_info.lists_given; i++)
59 fileNames.push_back(args_info.lists_arg[i]);
60 if (args_info.verbose_flag) std::cout<<"Adding input point list "<<fileNames[i]<<std::endl;
64 targetLists.ReadAndConvertPointPairs(fileNames, refList, referenceImage, args_info.verbose_flag );
67 if (args_info.ref_given) refList.Write(args_info.ref_arg, args_info.verbose_flag);
68 if (args_info.targets_given == args_info.lists_given)
71 std::vector<std::string> oFileNames;
72 for(unsigned int i=0; i< args_info.targets_given; i++)
73 oFileNames.push_back(args_info.targets_arg[i]);
74 targetLists.Write(oFileNames, args_info.verbose_flag);
81 //--------------------------------------------------------------------