itkOptMorphologyImageFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkOptMorphologyImageFilter_h
00018 #define __itkOptMorphologyImageFilter_h
00019
00020 #include "itkKernelImageFilter.h"
00021 #include "itkNeighborhoodIterator.h"
00022 #include "itkConstNeighborhoodIterator.h"
00023 #include "itkNeighborhood.h"
00024 #include "itkConstSliceIterator.h"
00025 #include "itkImageBoundaryCondition.h"
00026 #include "itkConstantBoundaryCondition.h"
00027 #include "itkImageRegionIterator.h"
00028
00029 namespace itk {
00030
00071 template<class TInputImage, class TOutputImage, class TKernel>
00072 class ITK_EXPORT MorphologyImageFilter :
00073 public KernelImageFilter<TInputImage, TOutputImage, TKernel>
00074 {
00075 public:
00077 typedef MorphologyImageFilter Self;
00078 typedef KernelImageFilter<TInputImage,TOutputImage, TKernel> Superclass;
00079 typedef SmartPointer<Self> Pointer;
00080 typedef SmartPointer<const Self> ConstPointer;
00081
00083 itkTypeMacro(MorphologyImageFilter, KernelImageFilter);
00084
00086 typedef TInputImage InputImageType;
00087 typedef TOutputImage OutputImageType;
00088 typedef typename TInputImage::RegionType RegionType;
00089 typedef typename TInputImage::SizeType SizeType;
00090 typedef typename TInputImage::IndexType IndexType;
00091 typedef typename TInputImage::PixelType PixelType;
00092 typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00093
00095 itkStaticConstMacro(ImageDimension, unsigned int,
00096 TInputImage::ImageDimension);
00097
00099 typedef ImageBoundaryCondition<InputImageType> * ImageBoundaryConditionPointerType;
00100 typedef ImageBoundaryCondition<InputImageType> const * ImageBoundaryConditionConstPointerType;
00101 typedef ConstantBoundaryCondition<InputImageType> DefaultBoundaryConditionType;
00102
00103
00105 typedef ConstNeighborhoodIterator<TInputImage> NeighborhoodIteratorType;
00106
00108 typedef TKernel KernelType;
00109
00111 typedef typename KernelType::ConstIterator KernelIteratorType;
00112
00114 typedef typename KernelType::SizeType RadiusType;
00115
00121 void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
00122 {
00123 m_BoundaryCondition = i;
00124 }
00125
00127 void ResetBoundaryCondition()
00128 {
00129 m_BoundaryCondition = &m_DefaultBoundaryCondition;
00130 }
00131
00133 itkGetConstMacro(BoundaryCondition, ImageBoundaryConditionPointerType);
00134
00135 protected:
00136 MorphologyImageFilter();
00137 ~MorphologyImageFilter() {};
00138 void PrintSelf(std::ostream& os, Indent indent) const;
00139
00141 void ThreadedGenerateData (const OutputImageRegionType&
00142 outputRegionForThread,
00143 int threadId);
00144
00147 virtual PixelType Evaluate(const NeighborhoodIteratorType &nit,
00148 const KernelIteratorType kernelBegin,
00149 const KernelIteratorType kernelEnd)=0;
00150
00151 private:
00152 MorphologyImageFilter(const Self&);
00153 void operator=(const Self&);
00154
00157 ImageBoundaryConditionPointerType m_BoundaryCondition;
00158
00160 DefaultBoundaryConditionType m_DefaultBoundaryCondition;
00161
00162 };
00163
00164 }
00165
00166 #ifndef ITK_MANUAL_INSTANTIATION
00167 #include "itkOptMorphologyImageFilter.txx"
00168 #endif
00169
00170 #endif
00171