00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkBinaryErodeImageFilter_h
00018 #define __itkBinaryErodeImageFilter_h
00019
00020 #include <vector>
00021 #include <queue>
00022 #include "itkBinaryMorphologyImageFilter.h"
00023 #include "itkImage.h"
00024 #include "itkNumericTraits.h"
00025 #include "itkNeighborhoodIterator.h"
00026 #include "itkConstNeighborhoodIterator.h"
00027 #include "itkNeighborhood.h"
00028 #include "itkImageBoundaryCondition.h"
00029 #include "itkImageRegionIterator.h"
00030 #include "itkConceptChecking.h"
00031
00032 namespace itk
00033 {
00071 template <class TInputImage, class TOutputImage, class TKernel>
00072 class ITK_EXPORT BinaryErodeImageFilter :
00073 public BinaryMorphologyImageFilter< TInputImage, TOutputImage, TKernel >
00074 {
00075 public:
00077 itkStaticConstMacro(InputImageDimension, unsigned int,
00078 TInputImage::ImageDimension);
00079 itkStaticConstMacro(OutputImageDimension, unsigned int,
00080 TOutputImage::ImageDimension);
00081
00083 itkStaticConstMacro(KernelDimension, unsigned int,
00084 TKernel::NeighborhoodDimension);
00085
00087 typedef TInputImage InputImageType;
00088 typedef TOutputImage OutputImageType;
00089 typedef TKernel KernelType;
00090
00091
00093 typedef BinaryErodeImageFilter Self;
00094 typedef BinaryMorphologyImageFilter< InputImageType, OutputImageType, KernelType> Superclass;
00095 typedef SmartPointer<Self> Pointer;
00096 typedef SmartPointer<const Self> ConstPointer;
00097
00099 itkNewMacro(Self);
00100
00102 itkTypeMacro(BinaryErodeImageFilter, BinaryMorphologyImageFilter);
00103
00105 typedef typename KernelType::ConstIterator KernelIteratorType ;
00106
00108 typedef typename InputImageType::PixelType InputPixelType;
00109 typedef typename OutputImageType::PixelType OutputPixelType;
00110 typedef typename NumericTraits<InputPixelType>::RealType InputRealType;
00111 typedef typename InputImageType::OffsetType OffsetType;
00112 typedef typename InputImageType::IndexType IndexType;
00113
00114 typedef typename InputImageType::RegionType InputImageRegionType;
00115 typedef typename OutputImageType::RegionType OutputImageRegionType;
00116 typedef typename InputImageType::SizeType InputSizeType;
00117
00121 void SetErodeValue(const InputPixelType& value)
00122 { this->SetForegroundValue( value ); }
00123
00127 InputPixelType GetErodeValue() const
00128 { return this->GetForegroundValue(); }
00129
00130 protected:
00131 BinaryErodeImageFilter();
00132 virtual ~BinaryErodeImageFilter(){}
00133 void PrintSelf(std::ostream& os, Indent indent) const;
00134
00145 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId );
00146
00147 void BeforeThreadedGenerateData();
00148
00149
00150 typedef typename Superclass::NeighborIndexContainer NeighborIndexContainer;
00151 typedef typename Superclass::BorderCellContainer BorderCellContainer;
00152 typedef typename Superclass::BorderCell BorderCell;
00153
00154 private:
00155 BinaryErodeImageFilter(const Self&);
00156 void operator=(const Self&);
00157
00158 };
00159
00160 }
00161
00162 #ifndef ITK_MANUAL_INSTANTIATION
00163 #include "itkBinaryErodeImageFilter.txx"
00164 #endif
00165
00166 #endif