]> Creatis software - clitk.git/blob - filters/clitkImageArithmGenericFilter.h
removed headers
[clitk.git] / filters / clitkImageArithmGenericFilter.h
1 #ifndef CLITKIMAGEARITHMGENERICFILTER_H
2 #define CLITKIMAGEARITHMGENERICFILTER_H
3 /**
4  -------------------------------------------------------------------
5  * @file   clitkImageArithmGenericFilter.h
6  * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
7  * @date   23 Feb 2008 08:37:53
8
9  * @brief  
10  -------------------------------------------------------------------*/
11
12 // clitk include
13 #include "clitkCommon.h"
14 #include "clitkImageToImageGenericFilter.h"
15
16 // itk include
17 #include "itkImage.h"
18 #include "itkImageIOBase.h"
19 #include "itkImageRegionIterator.h"
20 #include "itkImageRegionConstIterator.h"
21
22 //--------------------------------------------------------------------
23 namespace clitk {
24   
25   template<class args_info_type>
26   class ITK_EXPORT ImageArithmGenericFilter:
27     public clitk::ImageToImageGenericFilter<ImageArithmGenericFilter<args_info_type> > {
28     
29   public:
30         
31     // Constructor 
32     ImageArithmGenericFilter ();
33
34     // Types
35     typedef ImageArithmGenericFilter        Self;
36     typedef ImageToImageGenericFilterBase   Superclass;
37     typedef itk::SmartPointer<Self>         Pointer;
38     typedef itk::SmartPointer<const Self>   ConstPointer;
39
40     // New
41     itkNewMacro(Self);
42     
43     //--------------------------------------------------------------------
44     void SetArgsInfo(const args_info_type & a);
45
46     // Set methods
47     void SetDefaultPixelValue (double value) {  mDefaultPixelValue = value ;}
48     void SetTypeOfOperation (int value) {  mTypeOfOperation = value ;}
49     void SetScalar (double value) {  mScalar = value ;}
50     void EnableOverwriteInputImage(bool b);
51
52     // Get methods
53     double GetDefaultPixelValue () { return  mDefaultPixelValue ;} 
54     int GetTypeOfOperation () { return  mTypeOfOperation ;} 
55     double GetScalar () { return  mScalar ;} 
56
57     //--------------------------------------------------------------------
58     // Main function called each time the filter is updated
59     template<class InputImageType>  
60     void UpdateWithInputImageType();
61
62   protected:  
63     template<unsigned int Dim> void InitializeImageType();
64     bool mIsOperationUseASecondImage;
65     double mScalar;
66     double mDefaultPixelValue;
67     int mTypeOfOperation;  
68     args_info_type mArgsInfo;
69     bool mOverwriteInputImage;
70     bool mOutputIsFloat;
71     
72     template<class Iter1, class Iter2>
73       void ComputeImage(Iter1 it, Iter2 ito);
74
75     template<class Iter1, class Iter2, class Iter3>
76       void ComputeImage(Iter1 it1, Iter2 it2, Iter3 ito);
77
78     //--------------------------------------------------------------------
79
80   }; // end class ImageArithmGenericFilter
81 } // end namespace
82 //--------------------------------------------------------------------
83
84 #ifndef ITK_MANUAL_INSTANTIATION
85 #include "clitkImageArithmGenericFilter.txx"
86 #endif
87
88 #endif //#define CLITKIMAGEARITHMGENERICFILTER_H
89