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: 2009-04-25 12:27:36 $
00007   Version:   $Revision: 1.21 $
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 // First make sure that the configuration is available.
00021 // This line can be removed once the optimized versions
00022 // gets integrated into the main directories.
00023 #include "itkConfigure.h"
00024 
00025 #ifdef ITK_USE_CONSOLIDATED_MORPHOLOGY
00026 #include "itkOptMorphologyImageFilter.h"
00027 #else
00028 
00029 
00030 #include "itkImageToImageFilter.h"
00031 #include "itkNeighborhoodIterator.h"
00032 #include "itkConstNeighborhoodIterator.h"
00033 #include "itkNeighborhood.h"
00034 #include "itkConstSliceIterator.h"
00035 #include "itkImageBoundaryCondition.h"
00036 #include "itkConstantBoundaryCondition.h"
00037 #include "itkImageRegionIterator.h"
00038 
00039 namespace itk {
00040 
00081 template<class TInputImage, class TOutputImage, class TKernel>
00082 class ITK_EXPORT MorphologyImageFilter : 
00083     public ImageToImageFilter<TInputImage, TOutputImage>
00084 {
00085 public:
00087   typedef MorphologyImageFilter                         Self;
00088   typedef ImageToImageFilter<TInputImage,TOutputImage>  Superclass;
00089   typedef SmartPointer<Self>                            Pointer;
00090   typedef SmartPointer<const Self>                      ConstPointer;
00091 
00093   itkTypeMacro(MorphologyImageFilter, ImageToImageFilter);
00094 
00096   typedef TInputImage                                   InputImageType;
00097   typedef TOutputImage                                  OutputImageType;
00098   typedef typename TInputImage::RegionType              RegionType;
00099   typedef typename TInputImage::SizeType                SizeType;
00100   typedef typename TInputImage::IndexType               IndexType;
00101   typedef typename TInputImage::PixelType               PixelType;
00102   typedef typename Superclass::OutputImageRegionType    OutputImageRegionType;
00103 
00105   itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
00106 
00108   typedef ImageBoundaryCondition<InputImageType> *       ImageBoundaryConditionPointerType;
00109   typedef ImageBoundaryCondition<InputImageType> const * ImageBoundaryConditionConstPointerType;
00110   typedef ConstantBoundaryCondition<InputImageType>      DefaultBoundaryConditionType;
00111 
00112 
00114   typedef ConstNeighborhoodIterator<TInputImage> 
00115   NeighborhoodIteratorType;
00116 
00118   typedef TKernel KernelType;
00119 
00121   typedef typename KernelType::ConstIterator KernelIteratorType;
00122 
00124   typedef typename KernelType::SizeType RadiusType;
00125 
00127   itkSetMacro(Kernel, KernelType);
00128 
00130   itkGetConstReferenceMacro(Kernel, KernelType);
00131 
00137   void GenerateInputRequestedRegion();
00138 
00144   void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i)
00145     { m_BoundaryCondition = i; }
00146 
00148   void ResetBoundaryCondition()
00149     { m_BoundaryCondition = &m_DefaultBoundaryCondition; }
00150 
00152   itkGetConstMacro(BoundaryCondition, ImageBoundaryConditionPointerType);
00153 
00154 protected:
00155   MorphologyImageFilter();
00156   ~MorphologyImageFilter() {};
00157   void PrintSelf(std::ostream& os, Indent indent) const;
00158 
00160   void  ThreadedGenerateData (const OutputImageRegionType& 
00161                               outputRegionForThread,
00162                               int threadId);
00163 
00166   virtual PixelType Evaluate(const NeighborhoodIteratorType &nit,
00167                              const KernelIteratorType kernelBegin,
00168                              const KernelIteratorType kernelEnd)=0;
00169 
00170 private:
00171   MorphologyImageFilter(const Self&); //purposely not implemented
00172   void operator=(const Self&); //purposely not implemented
00173 
00175   KernelType m_Kernel;
00176 
00179   ImageBoundaryConditionPointerType m_BoundaryCondition;
00180 
00182   DefaultBoundaryConditionType m_DefaultBoundaryCondition;
00183 
00184 }; // end of class
00185 
00186 } // end namespace itk
00187   
00188 #ifndef ITK_MANUAL_INSTANTIATION
00189 #include "itkMorphologyImageFilter.txx"
00190 #endif
00191 
00192 #endif
00193 
00194 #endif
00195 

Generated at Tue Sep 15 04:00:22 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000