1 #ifndef clitkDecomposeAndReconstructImageFilter_h
2 #define clitkDecomposeAndReconstructImageFilter_h
4 /* =================================================
5 * @file clitkDecomposeAndReconstructImageFilter.h
11 ===================================================*/
16 #include "clitkCommon.h"
17 #include "clitkDecomposeThroughErosionImageFilter.h"
18 #include "clitkReconstructThroughDilationImageFilter.h"
21 #include "itkImageToImageFilter.h"
22 #include "itkRelabelComponentImageFilter.h"
28 template <class InputImageType, class OutputImageType>
29 class ITK_EXPORT DecomposeAndReconstructImageFilter :
30 public itk::ImageToImageFilter<InputImageType, OutputImageType>
33 //----------------------------------------
35 //----------------------------------------
36 typedef DecomposeAndReconstructImageFilter Self;
37 typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass;
38 typedef itk::SmartPointer<Self> Pointer;
39 typedef itk::SmartPointer<const Self> ConstPointer;
41 // Method for creation through the object factory
44 // Run-time type information (and related methods)
45 itkTypeMacro( DecomposeAndReconstructImageFilter, ImageToImageFilter );
47 /** Dimension of the domain space. */
48 itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
49 itkStaticConstMacro(OutputImageDimension, unsigned int, Superclass::OutputImageDimension);
51 //----------------------------------------
53 //----------------------------------------
54 typedef typename OutputImageType::RegionType OutputImageRegionType;
55 typedef int InternalPixelType;
56 typedef typename InputImageType::PixelType InputPixelType;
57 typedef typename OutputImageType::PixelType OutputPixelType;
58 typedef typename InputImageType::SizeType SizeType;
61 //----------------------------------------
63 //----------------------------------------
64 itkBooleanMacro(Verbose);
65 itkSetMacro( Verbose, bool);
66 itkGetConstReferenceMacro( Verbose, bool);
67 itkBooleanMacro(FullyConnected);
68 itkSetMacro( FullyConnected, bool);
69 itkGetConstReferenceMacro( FullyConnected, bool);
70 void SetRadius ( const SizeType& s){ m_Radius=s; this->Modified();}
71 SizeType GetRadius(void){return m_Radius;}
72 itkSetMacro( MaximumNumberOfLabels, unsigned int);
73 itkGetConstMacro( MaximumNumberOfLabels, unsigned int);
74 itkSetMacro( BackgroundValue, InternalPixelType);
75 itkGetConstMacro( BackgroundValue, InternalPixelType);
76 itkSetMacro( ForegroundValue, InternalPixelType);
77 itkGetConstMacro( ForegroundValue, InternalPixelType);
78 itkSetMacro( NumberOfNewLabels, unsigned int);
79 itkGetConstMacro( NumberOfNewLabels, unsigned int);
80 itkSetMacro( MinimumObjectSize, unsigned int);
81 itkGetConstMacro( MinimumObjectSize, unsigned int);
82 itkSetMacro( MinimumNumberOfIterations, unsigned int);
83 itkGetConstMacro( MinimumNumberOfIterations, unsigned int);
84 // // Convenience macro's: Built-in
85 // itkBooleanMacro (flag); //FlagOn FlagOff
86 // itkGetMacro(name, type);
87 // itkSetMacro(name, type);
88 // itkSetConstMacro( name, type);
89 // itkGetConstMacro( name, type);
90 // itkSetConstReferenceMacro(name, type);
91 // itkGetConstReferenceMacro(name, type);
92 // // Convenience macro's: Smartpointers
93 // itkSetObjectMacro(name, type);
94 // itkGetObjectMacro(name, type);
95 // itkSetConstObjectMacro(name, type);
96 // itkGetConstObjectMacro(name, type);
97 // itkSetConstReferenceObjectMacro(name, type);
98 // itkSetConstReference(name, type);
103 //----------------------------------------
104 // Constructor & Destructor
105 //----------------------------------------
106 DecomposeAndReconstructImageFilter();
107 ~DecomposeAndReconstructImageFilter() {};
109 //----------------------------------------
111 //----------------------------------------
113 void GenerateData(void);
115 // // Threaded Generate Data
116 // void BeforeThreadedGenerateData(void );
117 // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId );
118 // void AfterThreadedGenerateData(void );
119 // // Override defaults
120 // virtual void GenerateInputRequestedRegion();
121 // virtual void GenerateOutputInformation (void);
122 // virtual void EnlargeOutputRequestedRegion(DataObject *data);
123 void AllocateOutputs(){;}
124 //----------------------------------------
126 //----------------------------------------
129 unsigned int m_NumberOfNewLabels;
130 bool m_FullyConnected;
131 InputPixelType m_BackgroundValue;
132 InputPixelType m_ForegroundValue;
133 unsigned int m_MaximumNumberOfLabels;
134 unsigned int m_MinimumObjectSize;
135 unsigned int m_MinimumNumberOfIterations;
139 } // end namespace clitk
141 #ifndef ITK_MANUAL_INSTANTIATION
142 #include "clitkDecomposeAndReconstructImageFilter.txx"
145 #endif // #define clitkDecomposeAndReconstructImageFilter_h