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 clitkDecomposeAndReconstructImageFilter_h
19 #define clitkDecomposeAndReconstructImageFilter_h
21 /* =================================================
22 * @file clitkDecomposeAndReconstructImageFilter.h
28 ===================================================*/
33 #include "clitkCommon.h"
34 #include "clitkDecomposeThroughErosionImageFilter.h"
35 #include "clitkReconstructThroughDilationImageFilter.h"
38 #include "itkImageToImageFilter.h"
39 #include "itkRelabelComponentImageFilter.h"
45 template <class InputImageType, class OutputImageType>
46 class ITK_EXPORT DecomposeAndReconstructImageFilter :
47 public itk::ImageToImageFilter<InputImageType, OutputImageType>
50 //----------------------------------------
52 //----------------------------------------
53 typedef DecomposeAndReconstructImageFilter Self;
54 typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass;
55 typedef itk::SmartPointer<Self> Pointer;
56 typedef itk::SmartPointer<const Self> ConstPointer;
58 // Method for creation through the object factory
61 // Run-time type information (and related methods)
62 itkTypeMacro( DecomposeAndReconstructImageFilter, ImageToImageFilter );
64 /** Dimension of the domain space. */
65 itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
66 itkStaticConstMacro(OutputImageDimension, unsigned int, Superclass::OutputImageDimension);
68 //----------------------------------------
70 //----------------------------------------
71 typedef typename OutputImageType::RegionType OutputImageRegionType;
72 typedef int InternalPixelType;
73 typedef typename InputImageType::PixelType InputPixelType;
74 typedef typename OutputImageType::PixelType OutputPixelType;
75 typedef typename InputImageType::SizeType SizeType;
78 //----------------------------------------
80 //----------------------------------------
81 itkBooleanMacro(Verbose);
82 itkSetMacro( Verbose, bool);
83 itkGetConstReferenceMacro( Verbose, bool);
84 itkBooleanMacro(FullyConnected);
85 itkSetMacro( FullyConnected, bool);
86 itkGetConstReferenceMacro( FullyConnected, bool);
87 void SetRadius ( const SizeType& s){ m_Radius=s; this->Modified();}
88 SizeType GetRadius(void){return m_Radius;}
89 itkSetMacro( MaximumNumberOfLabels, unsigned int);
90 itkGetConstMacro( MaximumNumberOfLabels, unsigned int);
91 itkSetMacro( BackgroundValue, InternalPixelType);
92 itkGetConstMacro( BackgroundValue, InternalPixelType);
93 itkSetMacro( ForegroundValue, InternalPixelType);
94 itkGetConstMacro( ForegroundValue, InternalPixelType);
95 itkSetMacro( NumberOfNewLabels, unsigned int);
96 itkGetConstMacro( NumberOfNewLabels, unsigned int);
97 itkSetMacro( MinimumObjectSize, unsigned int);
98 itkGetConstMacro( MinimumObjectSize, unsigned int);
99 itkSetMacro( MinimumNumberOfIterations, unsigned int);
100 itkGetConstMacro( MinimumNumberOfIterations, unsigned int);
101 // // Convenience macro's: Built-in
102 // itkBooleanMacro (flag); //FlagOn FlagOff
103 // itkGetMacro(name, type);
104 // itkSetMacro(name, type);
105 // itkSetConstMacro( name, type);
106 // itkGetConstMacro( name, type);
107 // itkSetConstReferenceMacro(name, type);
108 // itkGetConstReferenceMacro(name, type);
109 // // Convenience macro's: Smartpointers
110 // itkSetObjectMacro(name, type);
111 // itkGetObjectMacro(name, type);
112 // itkSetConstObjectMacro(name, type);
113 // itkGetConstObjectMacro(name, type);
114 // itkSetConstReferenceObjectMacro(name, type);
115 // itkSetConstReference(name, type);
120 //----------------------------------------
121 // Constructor & Destructor
122 //----------------------------------------
123 DecomposeAndReconstructImageFilter();
124 ~DecomposeAndReconstructImageFilter() {};
126 //----------------------------------------
128 //----------------------------------------
130 void GenerateData(void);
132 // // Threaded Generate Data
133 // void BeforeThreadedGenerateData(void );
134 // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId );
135 // void AfterThreadedGenerateData(void );
136 // // Override defaults
137 // virtual void GenerateInputRequestedRegion();
138 // virtual void GenerateOutputInformation (void);
139 // virtual void EnlargeOutputRequestedRegion(DataObject *data);
140 void AllocateOutputs(){;}
141 //----------------------------------------
143 //----------------------------------------
146 unsigned int m_NumberOfNewLabels;
147 bool m_FullyConnected;
148 InputPixelType m_BackgroundValue;
149 InputPixelType m_ForegroundValue;
150 unsigned int m_MaximumNumberOfLabels;
151 unsigned int m_MinimumObjectSize;
152 unsigned int m_MinimumNumberOfIterations;
156 } // end namespace clitk
158 #ifndef ITK_MANUAL_INSTANTIATION
159 #include "clitkDecomposeAndReconstructImageFilter.txx"
162 #endif // #define clitkDecomposeAndReconstructImageFilter_h