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 #ifndef CLITKEXTRACTMEDIASTINUMSGENERICFILTER_TXX
20 #define CLITKEXTRACTMEDIASTINUMSGENERICFILTER_TXX
22 #include "clitkImageCommon.h"
24 //--------------------------------------------------------------------
25 template<class ArgsInfoType>
26 clitk::ExtractMediastinumGenericFilter<ArgsInfoType>::
27 ExtractMediastinumGenericFilter():
28 ImageToImageGenericFilter<Self>("ExtractMediastinum")
31 cmdline_parser_clitkExtractMediastinum_init(&mArgsInfo);
32 InitializeImageType<3>();
34 //--------------------------------------------------------------------
37 //--------------------------------------------------------------------
38 template<class ArgsInfoType>
39 template<unsigned int Dim>
41 clitk::ExtractMediastinumGenericFilter<ArgsInfoType>::
44 ADD_IMAGE_TYPE(Dim, short);
46 //--------------------------------------------------------------------
49 //--------------------------------------------------------------------
50 template<class ArgsInfoType>
52 clitk::ExtractMediastinumGenericFilter<ArgsInfoType>::
53 SetArgsInfo(const ArgsInfoType & a)
56 SetIOVerbose(mArgsInfo.verbose_flag);
57 if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
58 if (mArgsInfo.input_given) AddInputFilename(mArgsInfo.input_arg);
59 if (mArgsInfo.output_given) AddOutputFilename(mArgsInfo.output_arg);
61 //--------------------------------------------------------------------
64 //--------------------------------------------------------------------
65 template<class ArgsInfoType>
66 template<class FilterType>
68 clitk::ExtractMediastinumGenericFilter<ArgsInfoType>::
69 SetOptionsFromArgsInfoToFilter(FilterType * f)
71 f->SetVerboseOptionFlag(mArgsInfo.verbose_flag);
72 f->SetVerboseStepFlag(mArgsInfo.verboseStep_flag);
73 f->SetWriteStepFlag(mArgsInfo.writeStep_flag);
74 f->SetAFDBFilename(mArgsInfo.afdb_arg);
75 f->SetOutputMediastinumFilename(mArgsInfo.output_arg);
76 f->SetVerboseMemoryFlag(mArgsInfo.verboseMemory_flag);
78 f->SetDistanceMaxToAnteriorPartOfTheVertebralBody(mArgsInfo.maxAntSpine_arg);
79 f->SetUseBones(mArgsInfo.useBones_flag);
81 f->SetIntermediateSpacing(mArgsInfo.spacing_arg);
82 f->SetFuzzyThreshold("LR_lungs", mArgsInfo.ft_LR_lungs_arg);
83 f->SetFuzzyThreshold("bones", mArgsInfo.ft_bones_arg);
84 f->SetFuzzyThreshold("inf_lungs", mArgsInfo.ft_inf_lungs_arg);
85 f->SetFuzzyThreshold("ant_sternum", mArgsInfo.ft_ant_sternum_arg);
87 //--------------------------------------------------------------------
90 //--------------------------------------------------------------------
91 // Update with the number of dimensions and the pixeltype
92 //--------------------------------------------------------------------
93 template<class ArgsInfoType>
94 template<class ImageType>
95 void clitk::ExtractMediastinumGenericFilter<ArgsInfoType>::UpdateWithInputImageType()
98 typename ImageType::Pointer input = this->template GetInput<ImageType>(0);
101 typedef clitk::ExtractMediastinumFilter<ImageType> FilterType;
102 typename FilterType::Pointer filter = FilterType::New();
104 // Set global Options
105 filter->SetInput(input);
106 SetOptionsFromArgsInfoToFilter<FilterType>(filter);
111 // Write/Save results
112 typename FilterType::MaskImageType::Pointer output = filter->GetOutput();
113 this->template SetNextOutput<typename FilterType::MaskImageType>(output);
115 //--------------------------------------------------------------------
117 #endif //#define CLITKEXTRACTMEDIASTINUMSGENERICFILTER_TXX