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

itkOptMorphologyImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkOptMorphologyImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-23 03:43:42 $
00007   Version:   $Revision: 1.2 $
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 __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&); //purposely not implemented
00153   void operator=(const Self&); //purposely not implemented
00154 
00157   ImageBoundaryConditionPointerType m_BoundaryCondition;
00158 
00160   DefaultBoundaryConditionType      m_DefaultBoundaryCondition;
00161 
00162 }; // end of class
00163 
00164 } // end namespace itk
00165   
00166 #ifndef ITK_MANUAL_INSTANTIATION
00167 #include "itkOptMorphologyImageFilter.txx"
00168 #endif
00169 
00170 #endif
00171 

Generated at Mon Jul 12 2010 19:21:43 for ITK by doxygen 1.7.1 written by Dimitri van Heesch, © 1997-2000