]> Creatis software - clitk.git/blob - itk/clitkReconstructThroughDilationImageFilter.h
reconstruct with dilatation (jef)
[clitk.git] / itk / clitkReconstructThroughDilationImageFilter.h
1 #ifndef clitkReconstructThroughDilationImageFilter_h
2 #define clitkReconstructThroughDilationImageFilter_h
3
4 /* =================================================
5  * @file   clitkReconstructThroughDilationImageFilter.h
6  * @author 
7  * @date   
8  * 
9  * @brief 
10  * 
11  ===================================================*/
12
13
14 // clitk include
15 #include "clitkIO.h"
16 #include "clitkCommon.h"
17 #include "clitkConditionalBinaryDilateImageFilter.h"
18
19 //itk include
20 #include "itkImageToImageFilter.h"
21 #include "itkBinaryBallStructuringElement.h"
22 #include "itkConnectedComponentImageFilter.h"
23 #include "itkStatisticsImageFilter.h"
24 #include "itkCastImageFilter.h"
25 #include "itkDifferenceImageFilter.h"
26 #include "itkThresholdImageFilter.h"
27
28 namespace clitk 
29 {
30
31   template <class InputImageType, class OutputImageType>
32   class ITK_EXPORT ReconstructThroughDilationImageFilter :
33     public itk::ImageToImageFilter<InputImageType, OutputImageType>
34   {
35   public:
36     //----------------------------------------
37     // ITK
38     //----------------------------------------
39     typedef ReconstructThroughDilationImageFilter                                                 Self;
40     typedef itk::ImageToImageFilter<InputImageType, OutputImageType>  Superclass;
41     typedef itk::SmartPointer<Self>                                   Pointer;
42     typedef itk::SmartPointer<const Self>                             ConstPointer;
43    
44     // Method for creation through the object factory
45     itkNewMacro(Self);  
46
47     // Run-time type information (and related methods)
48     itkTypeMacro( ReconstructThroughDilationImageFilter, ImageToImageFilter );
49
50     /** Dimension of the domain space. */
51     itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
52     itkStaticConstMacro(OutputImageDimension, unsigned int, Superclass::OutputImageDimension);
53
54     //----------------------------------------
55     // Typedefs
56     //----------------------------------------
57     typedef typename OutputImageType::RegionType OutputImageRegionType;
58     typedef int InternalPixelType;
59     typedef typename InputImageType::PixelType InputPixelType;
60     typedef typename OutputImageType::PixelType OutputPixelType;
61     typedef typename InputImageType::SizeType SizeType;
62
63     //----------------------------------------
64     // Set & Get
65     //----------------------------------------    
66     itkBooleanMacro(Verbose);
67     itkSetMacro( Verbose, bool);
68     itkGetConstReferenceMacro( Verbose, bool);
69     void SetRadius ( const SizeType& s){ m_Radius=s; this->Modified();}
70     SizeType GetRadius(void){return m_Radius;}
71     itkSetMacro( ErosionPaddingValue, OutputPixelType);
72     itkGetConstMacro( ErosionPaddingValue, OutputPixelType)
73     itkSetMacro( MaximumNumberOfLabels, unsigned int);
74     itkGetConstMacro( MaximumNumberOfLabels, unsigned int);
75     itkSetMacro( BackgroundValue, InternalPixelType);
76     itkGetConstMacro( BackgroundValue, InternalPixelType);
77     itkSetMacro( ForegroundValue, InternalPixelType);
78     itkGetConstMacro( ForegroundValue, InternalPixelType);
79
80   protected:
81
82     //----------------------------------------  
83     // Constructor & Destructor
84     //----------------------------------------  
85     ReconstructThroughDilationImageFilter();
86     ~ReconstructThroughDilationImageFilter() {};
87
88     //----------------------------------------  
89     // Update
90     //----------------------------------------  
91     // Generate Data
92     void GenerateData(void);
93
94     //     // Threaded Generate Data
95     //     void BeforeThreadedGenerateData(void );
96     //     void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId );
97     //     void AfterThreadedGenerateData(void );
98     //     // Override defaults
99     //     virtual void GenerateInputRequestedRegion();
100     //     virtual void GenerateOutputInformation (void);
101     //     virtual void EnlargeOutputRequestedRegion(DataObject *data);
102     //     void AllocateOutputs();
103     //----------------------------------------  
104     // Data members
105     //----------------------------------------
106     bool m_Verbose;
107     InternalPixelType m_BackgroundValue;
108     InternalPixelType m_ForegroundValue;
109     unsigned int m_MaximumNumberOfLabels;
110     OutputPixelType m_ErosionPaddingValue;
111     SizeType m_Radius;
112
113   };
114
115
116 } // end namespace clitk
117
118 #ifndef ITK_MANUAL_INSTANTIATION
119 #include "clitkReconstructThroughDilationImageFilter.txx"
120 #endif
121
122 #endif // #define clitkReconstructThroughDilationImageFilter_h
123
124