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

itkOptGrayscaleMorphologicalOpeningImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkOptGrayscaleMorphologicalOpeningImageFilter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-04-23 03:43:42 $
00007   Version:   $Revision: 1.5 $
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 __itkOptGrayscaleMorphologicalOpeningImageFilter_h
00018 #define __itkOptGrayscaleMorphologicalOpeningImageFilter_h
00019 
00020 #include "itkKernelImageFilter.h"
00021 #include "itkMovingHistogramDilateImageFilter.h"
00022 #include "itkMovingHistogramErodeImageFilter.h"
00023 #include "itkBasicDilateImageFilter.h"
00024 #include "itkBasicErodeImageFilter.h"
00025 #include "itkAnchorOpenImageFilter.h"
00026 #include "itkVanHerkGilWermanErodeImageFilter.h"
00027 #include "itkVanHerkGilWermanDilateImageFilter.h"
00028 #include "itkCastImageFilter.h"
00029 #include "itkConstantBoundaryCondition.h"
00030 #include "itkFlatStructuringElement.h"
00031 #include "itkNeighborhood.h"
00032 
00033 namespace itk {
00034 
00050 template<class TInputImage, class TOutputImage, class TKernel>
00051 class ITK_EXPORT GrayscaleMorphologicalOpeningImageFilter : 
00052     public KernelImageFilter<TInputImage, TOutputImage, TKernel>
00053 {
00054 public:
00056   typedef GrayscaleMorphologicalOpeningImageFilter              Self;
00057   typedef KernelImageFilter<TInputImage,TOutputImage, TKernel>  Superclass;
00058   typedef SmartPointer<Self>                                    Pointer;
00059   typedef SmartPointer<const Self>                              ConstPointer;
00060 
00062   itkNewMacro(Self);  
00063 
00065   itkTypeMacro(GrayscaleMorphologicalOpeningImageFilter, 
00066                KernelImageFilter);
00067 
00069   itkStaticConstMacro(ImageDimension, unsigned int,
00070                       TInputImage::ImageDimension);
00071 
00073   typedef TInputImage                                           InputImageType;
00074   typedef TOutputImage                                          OutputImageType;
00075   typedef typename TInputImage::RegionType                      RegionType;
00076   typedef typename TInputImage::SizeType                        SizeType;
00077   typedef typename TInputImage::IndexType                       IndexType;
00078   typedef typename TInputImage::PixelType                       PixelType;
00079   typedef typename TInputImage::OffsetType                      OffsetType;
00080   typedef typename Superclass::OutputImageRegionType            OutputImageRegionType;
00081 
00082   typedef FlatStructuringElement< itkGetStaticConstMacro(ImageDimension) >
00083                                                                 FlatKernelType;
00084   typedef MovingHistogramDilateImageFilter< TInputImage, TOutputImage, TKernel >
00085                                                                 HistogramDilateFilterType;
00086   typedef MovingHistogramErodeImageFilter< TInputImage, TOutputImage, TKernel >
00087                                                                 HistogramErodeFilterType;
00088   typedef BasicErodeImageFilter< TInputImage, TInputImage, TKernel >
00089                                                                 BasicErodeFilterType;
00090   typedef BasicDilateImageFilter< TInputImage, TOutputImage, TKernel >
00091                                                                 BasicDilateFilterType;
00092   typedef AnchorOpenImageFilter< TInputImage, FlatKernelType >  AnchorFilterType;
00093   typedef VanHerkGilWermanErodeImageFilter< TInputImage, FlatKernelType >
00094                                                                 VanHerkGilWermanErodeFilterType;
00095   typedef VanHerkGilWermanDilateImageFilter< TInputImage, FlatKernelType >
00096                                                                 VanHerkGilWermanDilateFilterType;
00097   typedef CastImageFilter< TInputImage, TOutputImage >          SubtractFilterType;
00098   
00100   typedef TKernel                                               KernelType;
00101 //   typedef typename KernelType::Superclass KernelSuperClass;
00102 //   typedef Neighborhood< typename KernelType::PixelType, ImageDimension > KernelSuperClass;
00103 
00105   void SetKernel( const KernelType& kernel );
00106 
00108   void SetAlgorithm(int algo );
00109   itkGetConstMacro(Algorithm, int);
00111 
00113   virtual void Modified() const;
00114 
00116   enum {
00117     BASIC = 0,
00118     HISTO = 1,
00119     ANCHOR = 2,
00120     VHGW = 3
00121   } AlgorithmChoice;
00122 
00123 
00126   itkSetMacro(SafeBorder, bool);
00127   itkGetConstReferenceMacro(SafeBorder, bool);
00128   itkBooleanMacro(SafeBorder);
00130 
00131 protected:
00132   GrayscaleMorphologicalOpeningImageFilter();
00133   ~GrayscaleMorphologicalOpeningImageFilter() {};
00134   void PrintSelf(std::ostream& os, Indent indent) const;
00135   
00136   void GenerateData();
00137 
00138 private:
00139   GrayscaleMorphologicalOpeningImageFilter(const Self&); //purposely not implemented
00140   void operator=(const Self&); //purposely not implemented
00141 
00142   // the filters used internally
00143   typename HistogramDilateFilterType::Pointer        m_HistogramDilateFilter;
00144   typename HistogramErodeFilterType::Pointer         m_HistogramErodeFilter;
00145   typename BasicDilateFilterType::Pointer            m_BasicDilateFilter;
00146   typename BasicErodeFilterType::Pointer             m_BasicErodeFilter;
00147   typename VanHerkGilWermanDilateFilterType::Pointer m_VanHerkGilWermanDilateFilter;
00148   typename VanHerkGilWermanErodeFilterType::Pointer  m_VanHerkGilWermanErodeFilter;
00149   typename AnchorFilterType::Pointer                 m_AnchorFilter;
00150 
00151   // and the name of the filter
00152   int m_Algorithm;
00153 
00154   bool m_SafeBorder;
00155 
00156 }; // end of class
00157 
00158 } // end namespace itk
00159   
00160 #ifndef ITK_MANUAL_INSTANTIATION
00161 #include "itkOptGrayscaleMorphologicalOpeningImageFilter.txx"
00162 #endif
00163 
00164 #endif
00165 

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