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

itkGrayscaleErodeImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkGrayscaleErodeImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/04/30 21:02:03 $
00007   Version:   $Revision: 1.15 $
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 __itkGrayscaleErodeImageFilter_h
00018 #define __itkGrayscaleErodeImageFilter_h
00019 
00020 #include "itkImageToImageFilter.h"
00021 #include "itkMovingHistogramErodeImageFilter.h"
00022 #include "itkBasicErodeImageFilter.h"
00023 #include "itkConstantBoundaryCondition.h"
00024 
00025 namespace itk {
00026 
00042 template<class TInputImage, class TOutputImage, class TKernel>
00043 class ITK_EXPORT GrayscaleErodeImageFilter : 
00044     public ImageToImageFilter<TInputImage, TOutputImage>
00045 {
00046 public:
00048   typedef GrayscaleErodeImageFilter Self;
00049   typedef ImageToImageFilter<TInputImage,TOutputImage>  Superclass;
00050   typedef SmartPointer<Self>        Pointer;
00051   typedef SmartPointer<const Self>  ConstPointer;
00052 
00054   itkNewMacro(Self);  
00055 
00057   itkTypeMacro(GrayscaleErodeImageFilter, 
00058                ImageToImageFilter);
00059 
00061   typedef TInputImage InputImageType;
00062   typedef TOutputImage OutputImageType;
00063   typedef typename TInputImage::RegionType RegionType ;
00064   typedef typename TInputImage::SizeType SizeType ;
00065   typedef typename TInputImage::IndexType IndexType ;
00066   typedef typename TInputImage::PixelType PixelType ;
00067   typedef typename TInputImage::OffsetType OffsetType ;
00068   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00069 
00070   typedef MovingHistogramErodeImageFilter< TInputImage, TOutputImage, TKernel > HistogramFilterType;
00071   typedef BasicErodeImageFilter< TInputImage, TOutputImage, TKernel > BasicFilterType;
00072   
00074   itkStaticConstMacro(ImageDimension, unsigned int,
00075                       TInputImage::ImageDimension);
00076 
00078   typedef TKernel KernelType;
00079 
00081   typedef ImageBoundaryCondition<InputImageType> *ImageBoundaryConditionPointerType;
00082   typedef ImageBoundaryCondition<InputImageType> const *ImageBoundaryConditionConstPointerType;
00083   typedef ConstantBoundaryCondition<InputImageType> DefaultBoundaryConditionType;
00084 
00085 
00087   void SetKernel( const KernelType& kernel );
00088 
00090   itkGetConstReferenceMacro(Kernel, KernelType);
00091 
00093   void SetBoundary( const PixelType value );
00094   itkGetMacro(Boundary, PixelType);
00096 
00098   void SetNameOfBackendFilterClass( const char * name );
00099   itkGetMacro(NameOfBackendFilterClass, const char*);
00101 
00107   void GenerateInputRequestedRegion() ;
00108 
00110   virtual void Modified() const;
00111 
00118   void OverrideBoundaryCondition(const DefaultBoundaryConditionType* i)
00119     {
00120     itkLegacyBody(itk::GrayscaleErodeImageFilter::OverrideBoundaryCondition, 2.8);
00121     SetBoundary( i->GetConstant() );
00122     }
00124 
00128   const DefaultBoundaryConditionType* GetBoundaryCondition()
00129     {
00130     itkLegacyBody(itk::GrayscaleErodeImageFilter::GetBoundaryCondition, 2.8);
00131     return &m_BoundaryCondition;
00132     }
00134 
00138   void ResetBoundaryCondition()
00139     {
00140     itkLegacyBody(itk::GrayscaleErodeImageFilter::ResetBoundaryCondition, 2.8);
00141     SetBoundary( itk::NumericTraits< PixelType >::max() );
00142     }
00144 
00145 
00146 protected:
00147   GrayscaleErodeImageFilter();
00148   ~GrayscaleErodeImageFilter() {};
00149   void PrintSelf(std::ostream& os, Indent indent) const;
00150   
00151   void GenerateData();
00152 
00153 private:
00154   GrayscaleErodeImageFilter(const Self&); //purposely not implemented
00155   void operator=(const Self&); //purposely not implemented
00156 
00158   KernelType m_Kernel ;
00159 
00160   PixelType m_Boundary;
00161 
00162   // the filters used internally
00163   typename HistogramFilterType::Pointer m_HistogramFilter;
00164   typename BasicFilterType::Pointer m_BasicFilter;
00165 
00166   // and the name of the filter
00167   const char* m_NameOfBackendFilterClass;
00168 
00169   // the boundary condition need to be stored here
00170   DefaultBoundaryConditionType m_BoundaryCondition;
00171   
00172 } ; // end of class
00173 
00174 } // end namespace itk
00175   
00176 #ifndef ITK_MANUAL_INSTANTIATION
00177 #include "itkGrayscaleErodeImageFilter.txx"
00178 #endif
00179 
00180 #endif
00181 
00182 
00183 

Generated at Sat Sep 2 20:29:34 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000