00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGrayscaleErodeImageFilter_h
00018 #define __itkGrayscaleErodeImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkMovingHistogramErodeImageFilter.h"
00022 #include "itkBasicErodeImageFilter.h"
00023 #include "itkConstantBoundaryCondition.h"
00024
00025 namespace itk {
00026
00042 template<class TInputImage, class TOutputImage, class TKernel>
00043 class ITK_EXPORT GrayscaleErodeImageFilter :
00044 public ImageToImageFilter<TInputImage, TOutputImage>
00045 {
00046 public:
00048 typedef GrayscaleErodeImageFilter Self;
00049 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00050 typedef SmartPointer<Self> Pointer;
00051 typedef SmartPointer<const Self> ConstPointer;
00052
00054 itkNewMacro(Self);
00055
00057 itkTypeMacro(GrayscaleErodeImageFilter,
00058 ImageToImageFilter);
00059
00061 typedef TInputImage InputImageType;
00062 typedef TOutputImage OutputImageType;
00063 typedef typename TInputImage::RegionType RegionType ;
00064 typedef typename TInputImage::SizeType SizeType ;
00065 typedef typename TInputImage::IndexType IndexType ;
00066 typedef typename TInputImage::PixelType PixelType ;
00067 typedef typename TInputImage::OffsetType OffsetType ;
00068 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00069
00070 typedef MovingHistogramErodeImageFilter< TInputImage, TOutputImage, TKernel > HistogramFilterType;
00071 typedef BasicErodeImageFilter< TInputImage, TOutputImage, TKernel > BasicFilterType;
00072
00074 itkStaticConstMacro(ImageDimension, unsigned int,
00075 TInputImage::ImageDimension);
00076
00078 typedef TKernel KernelType;
00079
00081 typedef ImageBoundaryCondition<InputImageType> *ImageBoundaryConditionPointerType;
00082 typedef ImageBoundaryCondition<InputImageType> const *ImageBoundaryConditionConstPointerType;
00083 typedef ConstantBoundaryCondition<InputImageType> DefaultBoundaryConditionType;
00084
00085
00087 void SetKernel( const KernelType& kernel );
00088
00090 itkGetConstReferenceMacro(Kernel, KernelType);
00091
00093 void SetBoundary( const PixelType value );
00094 itkGetMacro(Boundary, PixelType);
00096
00098 void SetNameOfBackendFilterClass( const char * name );
00099 itkGetMacro(NameOfBackendFilterClass, const char*);
00101
00107 void GenerateInputRequestedRegion() ;
00108
00110 virtual void Modified() const;
00111
00118 void OverrideBoundaryCondition(const DefaultBoundaryConditionType* i)
00119 {
00120 itkLegacyBody(itk::GrayscaleErodeImageFilter::OverrideBoundaryCondition, 2.8);
00121 SetBoundary( i->GetConstant() );
00122 }
00124
00128 const DefaultBoundaryConditionType* GetBoundaryCondition()
00129 {
00130 itkLegacyBody(itk::GrayscaleErodeImageFilter::GetBoundaryCondition, 2.8);
00131 return &m_BoundaryCondition;
00132 }
00134
00138 void ResetBoundaryCondition()
00139 {
00140 itkLegacyBody(itk::GrayscaleErodeImageFilter::ResetBoundaryCondition, 2.8);
00141 SetBoundary( itk::NumericTraits< PixelType >::max() );
00142 }
00144
00145
00146 protected:
00147 GrayscaleErodeImageFilter();
00148 ~GrayscaleErodeImageFilter() {};
00149 void PrintSelf(std::ostream& os, Indent indent) const;
00150
00151 void GenerateData();
00152
00153 private:
00154 GrayscaleErodeImageFilter(const Self&);
00155 void operator=(const Self&);
00156
00158 KernelType m_Kernel ;
00159
00160 PixelType m_Boundary;
00161
00162
00163 typename HistogramFilterType::Pointer m_HistogramFilter;
00164 typename BasicFilterType::Pointer m_BasicFilter;
00165
00166
00167 const char* m_NameOfBackendFilterClass;
00168
00169
00170 DefaultBoundaryConditionType m_BoundaryCondition;
00171
00172 } ;
00173
00174 }
00175
00176 #ifndef ITK_MANUAL_INSTANTIATION
00177 #include "itkGrayscaleErodeImageFilter.txx"
00178 #endif
00179
00180 #endif
00181
00182
00183