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 void SetRadius(const int r) { for(uint i=0; i<InputImageDimension; i++) m_Radius[i] = r; SetRadius(m_Radius); }
88 SizeType GetRadius(void){return m_Radius;}
89 itkSetMacro( ErosionPaddingValue, OutputPixelType);
90 itkGetConstMacro( ErosionPaddingValue, OutputPixelType)
91 itkSetMacro( MaximumNumberOfLabels, unsigned int);
92 itkGetConstMacro( MaximumNumberOfLabels, unsigned int);
93 itkSetMacro( BackgroundValue, InternalPixelType);
94 itkGetConstMacro( BackgroundValue, InternalPixelType);
95 itkSetMacro( ForegroundValue, InternalPixelType);
96 itkGetConstMacro( ForegroundValue, InternalPixelType);
100 //----------------------------------------
101 // Constructor & Destructor
102 //----------------------------------------
103 ReconstructThroughDilationImageFilter();
104 ~ReconstructThroughDilationImageFilter() {};
106 //----------------------------------------
108 //----------------------------------------
110 void GenerateData(void);
112 // // Threaded Generate Data
113 // void BeforeThreadedGenerateData(void );
114 // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId );
115 // void AfterThreadedGenerateData(void );
116 // // Override defaults
117 // virtual void GenerateInputRequestedRegion();
118 // virtual void GenerateOutputInformation (void);
119 // virtual void EnlargeOutputRequestedRegion(DataObject *data);
120 // void AllocateOutputs();
121 //----------------------------------------
123 //----------------------------------------
125 InternalPixelType m_BackgroundValue;
126 InternalPixelType m_ForegroundValue;
127 unsigned int m_MaximumNumberOfLabels;
128 OutputPixelType m_ErosionPaddingValue;
134 } // end namespace clitk
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "clitkReconstructThroughDilationImageFilter.txx"
140 #endif // #define clitkReconstructThroughDilationImageFilter_h