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 CLITKDVHGENERICFILTER_H
19 #define CLITKDVHGENERICFILTER_H
23 #include "clitkCommon.h"
24 #include "clitkImageCommon.h"
25 #include "clitkImageToImageGenericFilter.h"
26 #include "clitkDVH_ggo.h"
30 #include "itkImageIOBase.h"
31 #include "itkImageRegionIterator.h"
32 #include "itkImageRegionConstIterator.h"
33 #include "itkLightObject.h"
34 #include "itkLabelStatisticsImageFilter.h"
35 #include "itkLabelGeometryImageFilter.h"
37 //--------------------------------------------------------------------
41 //template<class args_info_type>
42 class ITK_EXPORT DVHGenericFilter: public itk::LightObject
48 //--------------------------------------------------------------------
49 typedef DVHGenericFilter Self;
50 typedef itk::LightObject Superclass;
51 typedef itk::SmartPointer<Self> Pointer;
52 typedef itk::SmartPointer<const Self> ConstPointer;
54 //--------------------------------------------------------------------
55 // Method for creation through the object factory
56 // and Run-time type information (and related methods)
58 itkTypeMacro(DVHGenericFilter, LightObject);
60 //--------------------------------------------------------------------
61 void SetArgsInfo(const args_info_clitkDVH & a)
64 m_Verbose=m_ArgsInfo.verbose_flag;
66 if(m_ArgsInfo.input_given)
67 m_InputFileName=m_ArgsInfo.input_arg[0];
68 else if(m_ArgsInfo.inputs_num>0)
69 m_InputFileName=m_ArgsInfo.inputs[0];
71 std::cerr << "You must give an input file name" << std::endl;
75 //--------------------------------------------------------------------
76 // Main function called each time the filter is updated
77 //template<class InputImageType>
78 //void UpdateWithInputImageType();
82 void SetDefaultPixelValue (double value) { mDefaultPixelValue = value ;}
83 void SetTypeOfOperation (int value) { mTypeOfOperation = value ;}
84 void SetScalar (double value) { mScalar = value ;}
85 void EnableOverwriteInputImage(bool b);
88 double GetDefaultPixelValue () { return mDefaultPixelValue ;}
89 int GetTypeOfOperation () { return mTypeOfOperation ;}
90 double GetScalar () { return mScalar ;}
94 //--------------------------------------------------------------------
95 // Constructor & Destructor
97 ~DVHGenericFilter() {};
98 // template<unsigned int Dim> void InitializeImageType();
99 // args_info_type mArgsInfo;
101 //--------------------------------------------------------------------
103 //--------------------------------------------------------------------
104 template<unsigned int Dimension, unsigned int Components> void UpdateWithDim(std::string PixelType);
105 template <unsigned int Dimension, class PixelType, unsigned int Components> void UpdateWithDimAndPixelType();
107 //--------------------------------------------------------------------
109 //--------------------------------------------------------------------
110 args_info_clitkDVH m_ArgsInfo;
112 std::string m_InputFileName;
114 template<unsigned int Dim> void InitializeImageType();
115 bool mIsOperationUseASecondImage;
117 double mDefaultPixelValue;
118 int mTypeOfOperation;
119 bool mOverwriteInputImage;
122 template<class Iter1, class Iter2> void ComputeImage(Iter1 it, Iter2 ito);
124 template<class Iter1, class Iter2, class Iter3> void ComputeImage(Iter1 it1, Iter2 it2, Iter3 ito);
128 //--------------------------------------------------------------------
130 } // end namespace clitk
132 #ifndef ITK_MANUAL_INSTANTIATION
133 #include "clitkDVHGenericFilter.txx"
136 #endif // #define clitkDVHGenericFilter_h