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 // Set RelativePositionList filenames
82 for(uint i=0; i<mArgsInfo.relpos_given; i++) {
83 f->AddRelativePositionListFilename(mArgsInfo.relpos_arg[i]);
86 //--------------------------------------------------------------------
89 //--------------------------------------------------------------------
90 // Update with the number of dimensions and the pixeltype
91 //--------------------------------------------------------------------
92 template<class ArgsInfoType>
93 template<class ImageType>
94 void clitk::ExtractMediastinumGenericFilter<ArgsInfoType>::UpdateWithInputImageType()
97 typename ImageType::Pointer input = this->template GetInput<ImageType>(0);
100 typedef clitk::ExtractMediastinumFilter<ImageType> FilterType;
101 typename FilterType::Pointer filter = FilterType::New();
103 // Set global Options
104 filter->SetInput(input);
105 SetOptionsFromArgsInfoToFilter<FilterType>(filter);
110 // Write/Save results
111 typename FilterType::MaskImageType::Pointer output = filter->GetOutput();
112 this->template SetNextOutput<typename FilterType::MaskImageType>(output);
114 //--------------------------------------------------------------------
116 #endif //#define CLITKEXTRACTMEDIASTINUMSGENERICFILTER_TXX