]> Creatis software - clitk.git/blob - itk/clitkConditionalBinaryErodeImageFilter.h
Debug RTStruct conversion with empty struc
[clitk.git] / itk / clitkConditionalBinaryErodeImageFilter.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 #ifndef clitkConditionalBinaryErodeImageFilter_h
19 #define clitkConditionalBinaryErodeImageFilter_h
20
21 /* =================================================
22  * @file   clitkConditionalBinaryErodeImageFilter.h
23  * @author 
24  * @date   
25  * 
26  * @brief 
27  * 
28  ===================================================*/
29
30
31 // clitk include
32 #include "clitkIO.h"
33 #include "clitkCommon.h"
34
35 //itk include
36 #include "itkImageToImageFilter.h"
37 #include <vector>
38 #include <queue>
39 #include "itkBinaryMorphologyImageFilter.h"
40 #include "itkImage.h"
41 #include "itkNumericTraits.h"
42 #include "itkNeighborhoodIterator.h"
43 #include "itkConstNeighborhoodIterator.h"
44 #include "itkNeighborhood.h"
45 #include "itkImageBoundaryCondition.h"
46 #include "itkImageRegionIterator.h"
47 #include "itkConceptChecking.h"
48
49 namespace clitk 
50 {
51
52   template <class TInputImage, class TOutputImage, class TKernel>
53   class ITK_EXPORT ConditionalBinaryErodeImageFilter :
54     public itk::BinaryMorphologyImageFilter< TInputImage, TOutputImage, TKernel >
55   {
56   public:
57     //----------------------------------------
58     // ITK
59     //----------------------------------------
60     typedef ConditionalBinaryErodeImageFilter                         Self;
61     typedef itk::BinaryMorphologyImageFilter<TInputImage, TOutputImage, TKernel> Superclass;
62     typedef itk::SmartPointer<Self>                                   Pointer;
63     typedef itk::SmartPointer<const Self>                             ConstPointer;
64    
65     // Method for creation through the object factory
66     itkNewMacro(Self);  
67
68     // Run-time type information (and related methods)
69     itkTypeMacro(BinaryErodeImageFilter, BinaryMorphologyImageFilterr );
70
71     /** Dimension of the domain space. */
72     itkStaticConstMacro(InputImageDimension, unsigned int, Superclass::InputImageDimension);
73     itkStaticConstMacro(OutputImageDimension, unsigned int, Superclass::OutputImageDimension);
74     /** Extract the dimension of the kernel */
75     itkStaticConstMacro(KernelDimension, unsigned int,
76                         TKernel::NeighborhoodDimension);
77  
78     //----------------------------------------
79     // Typedefs
80     //----------------------------------------
81     typedef TInputImage  InputImageType;
82     typedef TOutputImage OutputImageType;
83     typedef TKernel      KernelType;
84
85     /** Kernel (structuring element) iterator. */
86     typedef typename KernelType::ConstIterator KernelIteratorType;
87     
88     /** Image typedef support. */
89     typedef typename InputImageType::PixelType               InputPixelType;
90     typedef typename OutputImageType::PixelType              OutputPixelType;
91     typedef typename itk::NumericTraits<InputPixelType>::RealType InputRealType;
92     typedef typename InputImageType::OffsetType              OffsetType;
93     typedef typename InputImageType::IndexType               IndexType;
94     
95     typedef typename InputImageType::RegionType  InputImageRegionType;
96     typedef typename OutputImageType::RegionType OutputImageRegionType;
97     typedef typename InputImageType::SizeType    InputSizeType;
98     
99     /** Set the value in the image to consider as "foreground". Defaults to
100      * maximum value of PixelType. This is an alias to the
101      * ForegroundValue in the superclass. */
102     void SetErodeValue(const InputPixelType& value)
103     { this->SetForegroundValue( value ); }
104     
105     /** Get the value in the image considered as "foreground". Defaults to
106      * maximum value of PixelType. This is an alias to the
107      * ForegroundValue in the superclass. */
108     InputPixelType GetErodeValue() const
109     { return this->GetForegroundValue(); }
110     
111   protected:
112     ConditionalBinaryErodeImageFilter();
113     virtual ~ConditionalBinaryErodeImageFilter(){}
114     void PrintSelf(std::ostream& os, itk::Indent indent) const;
115     
116     void GenerateData();
117     
118     // type inherited from the superclass
119     typedef typename Superclass::NeighborIndexContainer NeighborIndexContainer;
120     
121   private:
122     ConditionalBinaryErodeImageFilter(const Self&); //purposely not implemented
123     void operator=(const Self&); //purposely not implemented
124     
125   };
126   
127   
128 } // end namespace clitk
129
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "clitkConditionalBinaryErodeImageFilter.txx"
132 #endif
133
134 #endif // #define clitkConditionalBinaryErodeImageFilter_h
135
136