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 clitkConditionalBinaryErodeImageFilter_h
19 #define clitkConditionalBinaryErodeImageFilter_h
21 /* =================================================
22 * @file clitkConditionalBinaryErodeImageFilter.h
28 ===================================================*/
33 #include "clitkCommon.h"
36 #include "itkImageToImageFilter.h"
39 #include "itkBinaryMorphologyImageFilter.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"
52 template <class TInputImage, class TOutputImage, class TKernel>
53 class ITK_EXPORT ConditionalBinaryErodeImageFilter :
54 public itk::BinaryMorphologyImageFilter< TInputImage, TOutputImage, TKernel >
57 //----------------------------------------
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;
65 // Method for creation through the object factory
68 // Run-time type information (and related methods)
69 itkTypeMacro(BinaryErodeImageFilter, BinaryMorphologyImageFilterr );
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);
78 //----------------------------------------
80 //----------------------------------------
81 typedef TInputImage InputImageType;
82 typedef TOutputImage OutputImageType;
83 typedef TKernel KernelType;
85 /** Kernel (structuring element) iterator. */
86 typedef typename KernelType::ConstIterator KernelIteratorType;
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;
95 typedef typename InputImageType::RegionType InputImageRegionType;
96 typedef typename OutputImageType::RegionType OutputImageRegionType;
97 typedef typename InputImageType::SizeType InputSizeType;
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 ); }
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(); }
112 ConditionalBinaryErodeImageFilter();
113 virtual ~ConditionalBinaryErodeImageFilter(){}
114 void PrintSelf(std::ostream& os, itk::Indent indent) const;
118 // type inherited from the superclass
119 typedef typename Superclass::NeighborIndexContainer NeighborIndexContainer;
122 ConditionalBinaryErodeImageFilter(const Self&); //purposely not implemented
123 void operator=(const Self&); //purposely not implemented
128 } // end namespace clitk
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "clitkConditionalBinaryErodeImageFilter.txx"
134 #endif // #define clitkConditionalBinaryErodeImageFilter_h