]> Creatis software - clitk.git/blob - itk/clitkReconstructWithConditionalGrayscaleDilateImageFilter.h
Merge branch 'master' into PacsConnection
[clitk.git] / itk / clitkReconstructWithConditionalGrayscaleDilateImageFilter.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to:
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
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================*/
18
19 #ifndef clitkReconstructWithConditionalGrayscaleDilateImageFilter_h
20 #define clitkReconstructWithConditionalGrayscaleDilateImageFilter_h
21
22 // clitk include
23 #include "clitkIO.h"
24 #include "clitkCommon.h"
25 #include "clitkConditionalGrayscaleDilateImageFilter.h"
26
27 namespace clitk 
28 {
29   /*
30     This filter takes as input a multilabel image (and a bg value).
31     It performs several greyscale dilatation of radius 1, but only in
32     the bg pixels. It means that when two objects (with different
33     labels) will dilate inside each other (collistion), the dilatation
34     is stopped.
35    */
36
37   template <class ImageType>
38   class ITK_EXPORT ReconstructWithConditionalGrayscaleDilateImageFilter :
39     public itk::ImageToImageFilter<ImageType, ImageType>
40   {
41   public:
42     //----------------------------------------
43     // ITK
44     //----------------------------------------
45     typedef ReconstructWithConditionalGrayscaleDilateImageFilter Self;
46     typedef itk::ImageToImageFilter<ImageType, ImageType>        Superclass;
47     typedef itk::SmartPointer<Self>                              Pointer;
48     typedef itk::SmartPointer<const Self>                        ConstPointer;
49    
50     // Method for creation through the object factory
51     itkNewMacro(Self);  
52
53     // Run-time type information (and related methods)
54     itkTypeMacro( ReconstructWithConditionalGrayscaleDilateImageFilter, ImageToImageFilter);
55
56     /** Dimension of the domain space. */
57     itkStaticConstMacro(ImageDimension, unsigned int, Superclass::InputImageDimension);
58
59     //----------------------------------------
60     // Typedefs
61     //----------------------------------------
62     typedef typename ImageType::PixelType PixelType;
63     typedef typename ImageType::SizeType SizeType;
64
65     //----------------------------------------
66     // Set & Get
67     //----------------------------------------    
68     itkBooleanMacro(Verbose);
69     itkSetMacro( Verbose, bool);
70     itkGetConstReferenceMacro( Verbose, bool);
71
72     itkSetMacro(IterationNumber, int);
73     itkGetConstMacro(IterationNumber, int);
74
75     itkSetMacro(BackgroundValue, PixelType);
76     itkGetConstMacro(BackgroundValue, PixelType);
77
78   protected:
79
80     //----------------------------------------  
81     // Constructor & Destructor
82     //----------------------------------------  
83     ReconstructWithConditionalGrayscaleDilateImageFilter();
84     ~ReconstructWithConditionalGrayscaleDilateImageFilter() {};
85
86     //----------------------------------------  
87     // Update
88     //----------------------------------------  
89     // Generate Data
90     void GenerateData(void);
91
92     //----------------------------------------  
93     // Data members
94     //----------------------------------------
95     bool m_Verbose;
96     PixelType m_BackgroundValue;
97     int m_IterationNumber;
98   };
99
100 } // end namespace clitk
101
102 #ifndef ITK_MANUAL_INSTANTIATION
103 #include "clitkReconstructWithConditionalGrayscaleDilateImageFilter.txx"
104 #endif
105
106 #endif // #define clitkReconstructWithConditionalGrayscaleDilateImageFilter_h
107
108