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 #if ITK_VERSION_MAJOR >= 4
43 #include "itkTestingComparisonImageFilter.h"
45 #include "itkDifferenceImageFilter.h"
47 #include "itkThresholdImageFilter.h"
52 template <class InputImageType, class OutputImageType>
53 class ITK_EXPORT ReconstructThroughDilationImageFilter :
54 public itk::ImageToImageFilter<InputImageType, OutputImageType>
57 //----------------------------------------
59 //----------------------------------------
60 typedef ReconstructThroughDilationImageFilter Self;
61 typedef itk::ImageToImageFilter<InputImageType, OutputImageType> Superclass;
62 typedef itk::SmartPointer<Self> Pointer;
63 typedef itk::SmartPointer<const Self> ConstPointer;
65 // Method for creation through the object factory
68 // Run-time type information (and related methods)
69 itkTypeMacro( ReconstructThroughDilationImageFilter, ImageToImageFilter );
71 /** Dimension of the domain space. */
72 itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
73 itkStaticConstMacro(OutputImageDimension, unsigned int, Superclass::OutputImageDimension);
75 //----------------------------------------
77 //----------------------------------------
78 typedef typename OutputImageType::RegionType OutputImageRegionType;
79 typedef int InternalPixelType;
80 typedef typename InputImageType::PixelType InputPixelType;
81 typedef typename OutputImageType::PixelType OutputPixelType;
82 typedef typename InputImageType::SizeType SizeType;
84 //----------------------------------------
86 //----------------------------------------
87 itkBooleanMacro(Verbose);
88 itkSetMacro( Verbose, bool);
89 itkGetConstReferenceMacro( Verbose, bool);
90 void SetRadius ( const SizeType& s){ m_Radius=s; this->Modified();}
91 void SetRadius(const int r) { for(uint i=0; i<InputImageDimension; i++) m_Radius[i] = r; SetRadius(m_Radius); }
92 SizeType GetRadius(void){return m_Radius;}
93 itkSetMacro( ErosionPaddingValue, OutputPixelType);
94 itkGetConstMacro( ErosionPaddingValue, OutputPixelType)
95 itkSetMacro( MaximumNumberOfLabels, unsigned int);
96 itkGetConstMacro( MaximumNumberOfLabels, unsigned int);
97 itkSetMacro( BackgroundValue, InternalPixelType);
98 itkGetConstMacro( BackgroundValue, InternalPixelType);
99 itkSetMacro( ForegroundValue, InternalPixelType);
100 itkGetConstMacro( ForegroundValue, InternalPixelType);
104 //----------------------------------------
105 // Constructor & Destructor
106 //----------------------------------------
107 ReconstructThroughDilationImageFilter();
108 ~ReconstructThroughDilationImageFilter() {};
110 //----------------------------------------
112 //----------------------------------------
114 void GenerateData(void);
116 // // Threaded Generate Data
117 // void BeforeThreadedGenerateData(void );
118 // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId );
119 // void AfterThreadedGenerateData(void );
120 // // Override defaults
121 // virtual void GenerateInputRequestedRegion();
122 // virtual void GenerateOutputInformation (void);
123 // virtual void EnlargeOutputRequestedRegion(DataObject *data);
124 // void AllocateOutputs();
125 //----------------------------------------
127 //----------------------------------------
129 InternalPixelType m_BackgroundValue;
130 InternalPixelType m_ForegroundValue;
131 unsigned int m_MaximumNumberOfLabels;
132 OutputPixelType m_ErosionPaddingValue;
138 } // end namespace clitk
140 #ifndef ITK_MANUAL_INSTANTIATION
141 #include "clitkReconstructThroughDilationImageFilter.txx"
144 #endif // #define clitkReconstructThroughDilationImageFilter_h