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->SetNumberOfBins(mArgsInfo.bins_arg);
68 f->SetAreaLossTolerance(mArgsInfo.tol_arg);
69 clitk::RelativePositionDirectionType d;
70 if (mArgsInfo.angle1_given) d.angle1 = clitk::deg2rad(mArgsInfo.angle1_arg);
71 if (mArgsInfo.angle2_given) d.angle2 = clitk::deg2rad(mArgsInfo.angle2_arg);
72 if (mArgsInfo.inverse_given) d.notFlag = clitk::deg2rad(mArgsInfo.inverse_flag);
75 //--------------------------------------------------------------------
78 //--------------------------------------------------------------------
79 // Update with the number of dimensions and the pixeltype
80 //--------------------------------------------------------------------
81 template<class ArgsInfoType>
82 template<class ImageType>
83 void clitk::RelativePositionAnalyzerGenericFilter<ArgsInfoType>::
84 UpdateWithInputImageType()
87 typedef clitk::RelativePositionAnalyzerFilter<ImageType> FilterType;
88 typename FilterType::Pointer filter = FilterType::New();
91 typename ImageType::Pointer support = this->template GetInput<ImageType>(0);
92 typename ImageType::Pointer object = this->template GetInput<ImageType>(1);
93 typename ImageType::Pointer target = this->template GetInput<ImageType>(2);
94 filter->SetInputSupport(support);
95 filter->SetInputObject(object);
96 filter->SetInputTarget(target);
99 SetOptionsFromArgsInfoToFilter<FilterType>(filter);
105 filter->GetInfo().Println();
106 filter->GetInfoReverse().Println();
108 //--------------------------------------------------------------------