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

itkOptMorphologicalGradientImageFilter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkOptMorphologicalGradientImageFilter.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 __itkOptMorphologicalGradientImageFilter_h
00018 #define __itkOptMorphologicalGradientImageFilter_h
00019 
00020 #include "itkKernelImageFilter.h"
00021 #include "itkMovingHistogramMorphologicalGradientImageFilter.h"
00022 #include "itkBasicDilateImageFilter.h"
00023 #include "itkBasicErodeImageFilter.h"
00024 #include "itkAnchorErodeImageFilter.h"
00025 #include "itkAnchorDilateImageFilter.h"
00026 #include "itkVanHerkGilWermanDilateImageFilter.h"
00027 #include "itkVanHerkGilWermanErodeImageFilter.h"
00028 #include "itkSubtractImageFilter.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 MorphologicalGradientImageFilter : 
00052     public KernelImageFilter<TInputImage, TOutputImage, TKernel>
00053 {
00054 public:
00056   typedef MorphologicalGradientImageFilter                      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(MorphologicalGradientImageFilter, 
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 MovingHistogramMorphologicalGradientImageFilter< TInputImage, TOutputImage, TKernel >
00085                                                                 HistogramFilterType;
00086   typedef BasicDilateImageFilter< TInputImage, TInputImage, TKernel >
00087                                                                 BasicDilateFilterType;
00088   typedef BasicErodeImageFilter< TInputImage, TInputImage, TKernel >
00089                                                                 BasicErodeFilterType;
00090   typedef AnchorDilateImageFilter< TInputImage, FlatKernelType >
00091                                                                 AnchorDilateFilterType;
00092   typedef AnchorErodeImageFilter< TInputImage, FlatKernelType > AnchorErodeFilterType;
00093   typedef VanHerkGilWermanDilateImageFilter< TInputImage, FlatKernelType >
00094                                                                 VHGWDilateFilterType;
00095   typedef VanHerkGilWermanErodeImageFilter< TInputImage, FlatKernelType > 
00096                                                                 VHGWErodeFilterType;
00097   typedef SubtractImageFilter< TInputImage, TInputImage, TOutputImage >
00098                                                                 SubtractFilterType;
00099   
00101   typedef TKernel                                               KernelType;
00102 //   typedef typename KernelType::Superclass KernelSuperClass;
00103 //   typedef Neighborhood< typename KernelType::PixelType, ImageDimension > KernelSuperClass;
00104 
00106   void SetKernel( const KernelType& kernel );
00107 
00109   void SetAlgorithm(int algo );
00110   itkGetConstMacro(Algorithm, int);
00112 
00114   virtual void Modified() const;
00115 
00117   enum {
00118     BASIC = 0,
00119     HISTO = 1,
00120     ANCHOR = 2,
00121     VHGW = 3
00122   } AlgorithmChoice;
00123 
00124 
00125 protected:
00126   MorphologicalGradientImageFilter();
00127   ~MorphologicalGradientImageFilter() {};
00128   void PrintSelf(std::ostream& os, Indent indent) const;
00129   
00130   void GenerateData();
00131 
00132 private:
00133   MorphologicalGradientImageFilter(const Self&); //purposely not implemented
00134   void operator=(const Self&); //purposely not implemented
00135 
00136   // the filters used internally
00137   typename HistogramFilterType::Pointer    m_HistogramFilter;
00138   typename BasicDilateFilterType::Pointer  m_BasicDilateFilter;
00139   typename BasicErodeFilterType::Pointer   m_BasicErodeFilter;
00140   typename AnchorDilateFilterType::Pointer m_AnchorDilateFilter;
00141   typename AnchorErodeFilterType::Pointer  m_AnchorErodeFilter;
00142   typename VHGWDilateFilterType::Pointer   m_VanHerkGilWermanDilateFilter;
00143   typename VHGWErodeFilterType::Pointer    m_VanHerkGilWermanErodeFilter;
00144 
00145   // and the name of the filter
00146   int                                      m_Algorithm;
00147 
00148 }; // end of class
00149 
00150 } // end namespace itk
00151   
00152 #ifndef ITK_MANUAL_INSTANTIATION
00153 #include "itkOptMorphologicalGradientImageFilter.txx"
00154 #endif
00155 
00156 #endif
00157 

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