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 clitkReconstructThroughDilationImageFilter_h
19 #define clitkReconstructThroughDilationImageFilter_h
21 /* =================================================
22 * @file clitkReconstructThroughDilationImageFilter.h
28 ===================================================*/
33 #include "clitkCommon.h"
34 #include "clitkConditionalBinaryDilateImageFilter.h"
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"
48 template <class InputImageType, class OutputImageType>
49 class ITK_EXPORT ReconstructThroughDilationImageFilter :
50 public itk::ImageToImageFilter<InputImageType, OutputImageType>
53 //----------------------------------------
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;
61 // Method for creation through the object factory
64 // Run-time type information (and related methods)
65 itkTypeMacro( ReconstructThroughDilationImageFilter, ImageToImageFilter );
67 /** Dimension of the domain space. */
68 itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
69 itkStaticConstMacro(OutputImageDimension, unsigned int, Superclass::OutputImageDimension);
71 //----------------------------------------
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;
80 //----------------------------------------
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);
99 //----------------------------------------
100 // Constructor & Destructor
101 //----------------------------------------
102 ReconstructThroughDilationImageFilter();
103 ~ReconstructThroughDilationImageFilter() {};
105 //----------------------------------------
107 //----------------------------------------
109 void GenerateData(void);
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 //----------------------------------------
122 //----------------------------------------
124 InternalPixelType m_BackgroundValue;
125 InternalPixelType m_ForegroundValue;
126 unsigned int m_MaximumNumberOfLabels;
127 OutputPixelType m_ErosionPaddingValue;
133 } // end namespace clitk
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "clitkReconstructThroughDilationImageFilter.txx"
139 #endif // #define clitkReconstructThroughDilationImageFilter_h