00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkMorphologyImageFilter_h
00018 #define __itkMorphologyImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkNeighborhoodIterator.h"
00022 #include "itkConstSmartNeighborhoodIterator.h"
00023 #include "itkNeighborhood.h"
00024 #include "itkConstSliceIterator.h"
00025 #include "itkImageBoundaryCondition.h"
00026 #include "itkImageRegionIterator.h"
00027
00028 namespace itk {
00029
00070 template<class TInputImage, class TOutputImage, class TKernel>
00071 class ITK_EXPORT MorphologyImageFilter :
00072 public ImageToImageFilter<TInputImage, TOutputImage>
00073 {
00074 public:
00076 typedef MorphologyImageFilter Self;
00077 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00078 typedef SmartPointer<Self> Pointer;
00079 typedef SmartPointer<const Self> ConstPointer;
00080
00082 itkTypeMacro(MorphologyImageFilter, ImageToImageFilter);
00083
00085 typedef TInputImage InputImageType;
00086 typedef TOutputImage OutputImageType;
00087 typedef typename TInputImage::RegionType RegionType ;
00088 typedef typename TInputImage::SizeType SizeType ;
00089 typedef typename TInputImage::IndexType IndexType ;
00090 typedef typename TInputImage::PixelType PixelType ;
00091 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00092
00094 itkStaticConstMacro(ImageDimension, unsigned int,
00095 TInputImage::ImageDimension);
00096
00098 typedef ConstNeighborhoodIterator<TInputImage>
00099 NeighborhoodIteratorType ;
00100 typedef ConstSmartNeighborhoodIterator<TInputImage>
00101 SmartNeighborhoodIteratorType ;
00102
00104 typedef TKernel KernelType;
00105
00107 typedef typename KernelType::ConstIterator KernelIteratorType ;
00108
00110 typedef typename KernelType::SizeType RadiusType ;
00111
00113 itkSetMacro(Kernel, KernelType);
00114
00116 itkGetConstReferenceMacro(Kernel, KernelType);
00117
00123 void GenerateInputRequestedRegion() ;
00124
00125 protected:
00126 MorphologyImageFilter();
00127 ~MorphologyImageFilter() {};
00128 void PrintSelf(std::ostream& os, Indent indent) const;
00129
00131 void ThreadedGenerateData (const OutputImageRegionType&
00132 outputRegionForThread,
00133 int threadId) ;
00134
00138 virtual PixelType Evaluate(const SmartNeighborhoodIteratorType &nit,
00139 const KernelType &kernel)=0;
00140
00144 virtual PixelType Evaluate(const NeighborhoodIteratorType &nit,
00145 const KernelType &kernel)=0;
00146
00147 private:
00148 MorphologyImageFilter(const Self&);
00149 void operator=(const Self&);
00150
00152 KernelType m_Kernel ;
00153
00154 } ;
00155
00156 }
00157
00158 #ifndef ITK_MANUAL_INSTANTIATION
00159 #include "itkMorphologyImageFilter.txx"
00160 #endif
00161
00162 #endif