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::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
22 LabelImageOverlapMeasureGenericFilter():
23 ImageToImageGenericFilter<Self>("LabelImageOverlapMeasure")
26 cmdline_parser_clitkDice_init(&mArgsInfo);
27 //InitializeImageType<2>();
28 InitializeImageType<3>();
30 //--------------------------------------------------------------------
33 //--------------------------------------------------------------------
34 template<class ArgsInfoType>
35 template<unsigned int Dim>
36 void clitk::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
39 ADD_IMAGE_TYPE(Dim, uchar);
41 //--------------------------------------------------------------------
44 //--------------------------------------------------------------------
45 template<class ArgsInfoType>
46 void clitk::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
47 SetArgsInfo(const ArgsInfoType & a)
50 //this->SetIOVerbose(mArgsInfo.verbose_flag);
51 if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
52 if (mArgsInfo.input1_given) this->AddInputFilename(mArgsInfo.input1_arg);
53 if (mArgsInfo.input2_given) this->AddInputFilename(mArgsInfo.input2_arg);
55 //--------------------------------------------------------------------
58 //--------------------------------------------------------------------
59 // Update with the number of dimensions and the pixeltype
60 //--------------------------------------------------------------------
61 template<class ArgsInfoType>
62 template<class FilterType>
63 void clitk::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
64 SetOptionsFromArgsInfoToFilter(FilterType * f)
66 f->SetLabel1(mArgsInfo.label1_arg);
67 f->SetLabel2(mArgsInfo.label2_arg);
68 f->SetVerboseFlag(mArgsInfo.verbose_flag);
69 f->SetLongFlag(mArgsInfo.long_flag);
71 //--------------------------------------------------------------------
74 //--------------------------------------------------------------------
75 // Update with the number of dimensions and the pixeltype
76 //--------------------------------------------------------------------
77 template<class ArgsInfoType>
78 template<class ImageType>
79 void clitk::LabelImageOverlapMeasureGenericFilter<ArgsInfoType>::
80 UpdateWithInputImageType()
83 typename ImageType::Pointer input1 = this->template GetInput<ImageType>(0);
84 typename ImageType::Pointer input2 = this->template GetInput<ImageType>(1);
87 typedef clitk::LabelImageOverlapMeasureFilter<ImageType> FilterType;
88 typename FilterType::Pointer filter = FilterType::New();
91 filter->SetInput(0, input1);
92 filter->SetInput(1, input2);
93 SetOptionsFromArgsInfoToFilter<FilterType>(filter);
99 // typename ImageType::Pointer output = filter->GetOutput();
100 // this->template SetNextOutput<ImageType>(output);
102 //--------------------------------------------------------------------