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 template<class ArgsInfoType>
21 clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
22 RelativePositionAnalyzerGenericFilter():
23 ImageToImageGenericFilter<Self>("RelativePositionAnalyzer")
26 cmdline_parser_clitkRelativePositionAnalyzer_init(&mArgsInfo);
27 InitializeImageType<3>();
29 //--------------------------------------------------------------------
32 //--------------------------------------------------------------------
33 template<class ArgsInfoType>
34 template<unsigned int Dim>
35 void clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
38 ADD_IMAGE_TYPE(Dim, uchar);
40 //--------------------------------------------------------------------
43 //--------------------------------------------------------------------
44 template<class ArgsInfoType>
45 void clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
46 SetArgsInfo(const ArgsInfoType & a)
49 SetIOVerbose(mArgsInfo.verbose_flag);
50 if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
51 if (mArgsInfo.support_given) AddInputFilename(mArgsInfo.support_arg);
52 if (mArgsInfo.object_given) AddInputFilename(mArgsInfo.object_arg);
53 if (mArgsInfo.target_given) AddInputFilename(mArgsInfo.target_arg);
54 if (mArgsInfo.output_given) AddOutputFilename(mArgsInfo.output_arg);
56 //--------------------------------------------------------------------
59 //--------------------------------------------------------------------
60 // Update with the number of dimensions and the pixeltype
61 //--------------------------------------------------------------------
62 template<class ArgsInfoType>
63 template<class FilterType>
64 void clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
65 SetOptionsFromArgsInfoToFilter(FilterType * f)
67 f->SetAFDBFilename(mArgsInfo.afdb_arg);
68 f->SetNumberOfBins(mArgsInfo.bins_arg);
69 f->SetNumberOfAngles(mArgsInfo.nb_arg);
70 f->SetAreaLossTolerance(mArgsInfo.tol_arg);
73 //--------------------------------------------------------------------
74 // Update with the number of dimensions and the pixeltype
75 //--------------------------------------------------------------------
76 template<class ArgsInfoType>
77 template<class ImageType>
78 void clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
79 UpdateWithInputImageType()
82 typedef clitk::RelativePositionAnalyzerFilter<ImageType> FilterType;
83 typename FilterType::Pointer filter = FilterType::New();
86 typename ImageType::Pointer support = this->template GetInput<ImageType>(0);
87 typename ImageType::Pointer object = this->template GetInput<ImageType>(1);
88 typename ImageType::Pointer target = this->template GetInput<ImageType>(2);
89 filter->SetInputSupport(support);
90 filter->SetInputObject(object);
91 filter->SetInputTarget(target);
94 SetOptionsFromArgsInfoToFilter<FilterType>(filter);
101 if (mArgsInfo.afdb_given) {
102 NewAFDB(afdb, mArgsInfo.afdb_arg);
103 std::string patient = afdb->GetTagValue("PatientID");
106 if (mArgsInfo.objectName_given) object = mArgsInfo.objectName_arg;
107 else object = mArgsInfo.object_arg;
108 if (mArgsInfo.supportName_given) support = mArgsInfo.supportName_arg;
109 else support = mArgsInfo.support_arg;
110 s = patient+" "+support+" "+object+" ";
112 filter->Print(s, std::cout);
114 //--------------------------------------------------------------------