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 ===========================================================================**/
18 #ifndef clitkFooImageGenericFilter_txx
19 #define clitkFooImageGenericFilter_txx
22 #include "itkBinaryThresholdImageFilter.h"
23 #include "itkMaskImageFilter.h"
24 #include "itkMaskNegatedImageFilter.h"
25 #include <clitkCommon.h>
30 //--------------------------------------------------------------------
31 template<class args_info_type>
32 FooImageGenericFilter<args_info_type>::FooImageGenericFilter():
33 ImageToImageGenericFilter<Self>("FooImage")
35 InitializeImageType<2>();
36 InitializeImageType<3>();
37 InitializeImageType<4>();
39 //--------------------------------------------------------------------
42 //--------------------------------------------------------------------
43 template<class args_info_type>
44 template<unsigned int Dim>
45 void FooImageGenericFilter<args_info_type>::InitializeImageType()
47 ADD_DEFAULT_IMAGE_TYPES(Dim);
49 //--------------------------------------------------------------------
52 //--------------------------------------------------------------------
53 template<class args_info_type>
54 void FooImageGenericFilter<args_info_type>::SetArgsInfo(const args_info_type & a)
57 this->SetIOVerbose(mArgsInfo.verbose_flag);
58 if (mArgsInfo.imagetypes_flag) this->PrintAvailableImageTypes();
60 if (mArgsInfo.input_given) {
61 this->SetInputFilename(mArgsInfo.input_arg);
63 if (mArgsInfo.output_given) {
64 this->SetOutputFilename(mArgsInfo.output_arg);
67 //--------------------------------------------------------------------
69 //--------------------------------------------------------------------
70 // Update with the number of dimensions and the pixeltype
71 //--------------------------------------------------------------------
72 template<class args_info_type>
73 template<class InputImageType>
75 FooImageGenericFilter<args_info_type>::UpdateWithInputImageType()
79 typename InputImageType::Pointer input = this->template GetInput<InputImageType>(0);
82 typedef typename InputImageType::PixelType PixelType;
83 typedef itk::Image<char, InputImageType::ImageDimension> OutputImageType;
86 typedef itk::BinaryThresholdImageFilter<InputImageType, OutputImageType> BinaryThresholdImageFilterType;
87 typename BinaryThresholdImageFilterType::Pointer thresholdFilter=BinaryThresholdImageFilterType::New();
88 thresholdFilter->SetInput(input);
92 typename OutputImageType::Pointer outputImage = thresholdFilter->GetOutput();
93 this->template SetNextOutput<OutputImageType>(outputImage);
95 //--------------------------------------------------------------------
100 #endif //#define clitkFooImageGenericFilter_txx