]> Creatis software - clitk.git/blob - itk/clitkReconstructThroughDilationImageFilter.h
Merge branch 'master' of /home/romulo/creatis/clitk3-git-shared/clitk3
[clitk.git] / itk / clitkReconstructThroughDilationImageFilter.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
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
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================*/
18 #ifndef clitkReconstructThroughDilationImageFilter_h
19 #define clitkReconstructThroughDilationImageFilter_h
20
21 /* =================================================
22  * @file   clitkReconstructThroughDilationImageFilter.h
23  * @author 
24  * @date   
25  * 
26  * @brief 
27  * 
28  ===================================================*/
29
30
31 // clitk include
32 #include "clitkIO.h"
33 #include "clitkCommon.h"
34 #include "clitkConditionalBinaryDilateImageFilter.h"
35
36 //itk include
37 #include "itkImageToImageFilter.h"
38 #include "itkBinaryBallStructuringElement.h"
39 #include "itkConnectedComponentImageFilter.h"
40 #include "itkStatisticsImageFilter.h"
41 #include "itkCastImageFilter.h"
42 #include "itkDifferenceImageFilter.h"
43 #include "itkThresholdImageFilter.h"
44
45 namespace clitk 
46 {
47
48   template <class InputImageType, class OutputImageType>
49   class ITK_EXPORT ReconstructThroughDilationImageFilter :
50     public itk::ImageToImageFilter<InputImageType, OutputImageType>
51   {
52   public:
53     //----------------------------------------
54     // ITK
55     //----------------------------------------
56     typedef ReconstructThroughDilationImageFilter                                                 Self;
57     typedef itk::ImageToImageFilter<InputImageType, OutputImageType>  Superclass;
58     typedef itk::SmartPointer<Self>                                   Pointer;
59     typedef itk::SmartPointer<const Self>                             ConstPointer;
60    
61     // Method for creation through the object factory
62     itkNewMacro(Self);  
63
64     // Run-time type information (and related methods)
65     itkTypeMacro( ReconstructThroughDilationImageFilter, ImageToImageFilter );
66
67     /** Dimension of the domain space. */
68     itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
69     itkStaticConstMacro(OutputImageDimension, unsigned int, Superclass::OutputImageDimension);
70
71     //----------------------------------------
72     // Typedefs
73     //----------------------------------------
74     typedef typename OutputImageType::RegionType OutputImageRegionType;
75     typedef int InternalPixelType;
76     typedef typename InputImageType::PixelType InputPixelType;
77     typedef typename OutputImageType::PixelType OutputPixelType;
78     typedef typename InputImageType::SizeType SizeType;
79
80     //----------------------------------------
81     // Set & Get
82     //----------------------------------------    
83     itkBooleanMacro(Verbose);
84     itkSetMacro( Verbose, bool);
85     itkGetConstReferenceMacro( Verbose, bool);
86     void SetRadius ( const SizeType& s){ m_Radius=s; this->Modified();}
87     SizeType GetRadius(void){return m_Radius;}
88     itkSetMacro( ErosionPaddingValue, OutputPixelType);
89     itkGetConstMacro( ErosionPaddingValue, OutputPixelType)
90     itkSetMacro( MaximumNumberOfLabels, unsigned int);
91     itkGetConstMacro( MaximumNumberOfLabels, unsigned int);
92     itkSetMacro( BackgroundValue, InternalPixelType);
93     itkGetConstMacro( BackgroundValue, InternalPixelType);
94     itkSetMacro( ForegroundValue, InternalPixelType);
95     itkGetConstMacro( ForegroundValue, InternalPixelType);
96
97   protected:
98
99     //----------------------------------------  
100     // Constructor & Destructor
101     //----------------------------------------  
102     ReconstructThroughDilationImageFilter();
103     ~ReconstructThroughDilationImageFilter() {};
104
105     //----------------------------------------  
106     // Update
107     //----------------------------------------  
108     // Generate Data
109     void GenerateData(void);
110
111     //     // Threaded Generate Data
112     //     void BeforeThreadedGenerateData(void );
113     //     void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId );
114     //     void AfterThreadedGenerateData(void );
115     //     // Override defaults
116     //     virtual void GenerateInputRequestedRegion();
117     //     virtual void GenerateOutputInformation (void);
118     //     virtual void EnlargeOutputRequestedRegion(DataObject *data);
119     //     void AllocateOutputs();
120     //----------------------------------------  
121     // Data members
122     //----------------------------------------
123     bool m_Verbose;
124     InternalPixelType m_BackgroundValue;
125     InternalPixelType m_ForegroundValue;
126     unsigned int m_MaximumNumberOfLabels;
127     OutputPixelType m_ErosionPaddingValue;
128     SizeType m_Radius;
129
130   };
131
132
133 } // end namespace clitk
134
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "clitkReconstructThroughDilationImageFilter.txx"
137 #endif
138
139 #endif // #define clitkReconstructThroughDilationImageFilter_h
140
141