Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkMorphologyImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkMorphologyImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/04/30 21:02:04 $
00007   Version:   $Revision: 1.17 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
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 "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 ImageToImageFilter<TInputImage, TOutputImage>
00074 {
00075 public:
00077   typedef MorphologyImageFilter Self;
00078   typedef ImageToImageFilter<TInputImage,TOutputImage>  Superclass;
00079   typedef SmartPointer<Self>        Pointer;
00080   typedef SmartPointer<const Self>  ConstPointer;
00081 
00083   itkTypeMacro(MorphologyImageFilter, ImageToImageFilter);
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> 
00106   NeighborhoodIteratorType ;
00107 
00109   typedef TKernel KernelType;
00110 
00112   typedef typename KernelType::ConstIterator KernelIteratorType ;
00113 
00115   typedef typename KernelType::SizeType RadiusType ;
00116 
00118   itkSetMacro(Kernel, KernelType);
00119 
00121   itkGetConstReferenceMacro(Kernel, KernelType);
00122 
00128   void GenerateInputRequestedRegion() ;
00129 
00135   void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
00136     { m_BoundaryCondition = i; }
00137 
00139   void ResetBoundaryCondition()
00140     { m_BoundaryCondition = &m_DefaultBoundaryCondition; }
00141 
00143   itkGetMacro(BoundaryCondition, ImageBoundaryConditionPointerType);
00144 
00145 protected:
00146   MorphologyImageFilter();
00147   ~MorphologyImageFilter() {};
00148   void PrintSelf(std::ostream& os, Indent indent) const;
00149 
00151   void  ThreadedGenerateData (const OutputImageRegionType& 
00152                               outputRegionForThread,
00153                               int threadId) ;
00154 
00157   virtual PixelType Evaluate(const NeighborhoodIteratorType &nit,
00158                              const KernelIteratorType kernelBegin,
00159                              const KernelIteratorType kernelEnd)=0;
00160 
00161 private:
00162   MorphologyImageFilter(const Self&); //purposely not implemented
00163   void operator=(const Self&); //purposely not implemented
00164 
00166   KernelType m_Kernel ;
00167 
00170   ImageBoundaryConditionPointerType m_BoundaryCondition;
00171 
00173   DefaultBoundaryConditionType m_DefaultBoundaryCondition;
00174 
00175 } ; // end of class
00176 
00177 } // end namespace itk
00178   
00179 #ifndef ITK_MANUAL_INSTANTIATION
00180 #include "itkMorphologyImageFilter.txx"
00181 #endif
00182 
00183 #endif
00184 

Generated at Tue Jul 29 21:19:52 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000