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 "itkConstNeighborhoodIterator.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
00102 typedef TKernel KernelType;
00103
00105 typedef typename KernelType::ConstIterator KernelIteratorType ;
00106
00108 typedef typename KernelType::SizeType RadiusType ;
00109
00111 itkSetMacro(Kernel, KernelType);
00112
00114 itkGetConstReferenceMacro(Kernel, KernelType);
00115
00121 void GenerateInputRequestedRegion() ;
00122
00123 protected:
00124 MorphologyImageFilter();
00125 ~MorphologyImageFilter() {};
00126 void PrintSelf(std::ostream& os, Indent indent) const;
00127
00129 void ThreadedGenerateData (const OutputImageRegionType&
00130 outputRegionForThread,
00131 int threadId) ;
00132
00135 virtual PixelType Evaluate(const NeighborhoodIteratorType &nit,
00136 const KernelType &kernel)=0;
00137
00138 private:
00139 MorphologyImageFilter(const Self&);
00140 void operator=(const Self&);
00141
00143 KernelType m_Kernel ;
00144
00145 } ;
00146
00147 }
00148
00149 #ifndef ITK_MANUAL_INSTANTIATION
00150 #include "itkMorphologyImageFilter.txx"
00151 #endif
00152
00153 #endif