00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkVanHerkGilWermanDilateImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date: 2009-02-24 19:03:15 $ 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 00018 #ifndef __itkVanHerkGilWermanDilateImageFilter_h 00019 #define __itkVanHerkGilWermanDilateImageFilter_h 00020 00021 #include "itkVanHerkGilWermanErodeDilateImageFilter.h" 00022 #include "vnl/vnl_math.h" 00023 00024 namespace itk { 00025 template <class TPixel> 00026 class MaxFunctor 00027 { 00028 public: 00029 MaxFunctor(){} 00030 ~MaxFunctor(){} 00031 inline TPixel operator()(const TPixel &A, const TPixel &B) const 00032 { 00033 return vnl_math_max(A, B); 00034 } 00035 }; 00036 00037 00038 template<class TImage, class TKernel> 00039 class ITK_EXPORT VanHerkGilWermanDilateImageFilter : 00040 public VanHerkGilWermanErodeDilateImageFilter<TImage, TKernel, MaxFunctor<typename TImage::PixelType> > 00041 00042 { 00043 public: 00044 typedef VanHerkGilWermanDilateImageFilter Self; 00045 typedef VanHerkGilWermanErodeDilateImageFilter<TImage, TKernel, MaxFunctor<typename TImage::PixelType> > Superclass; 00046 00048 itkTypeMacro(VanHerkGilWermanDilateImageFilter, 00049 VanHerkGilWermanErodeDilateImageFilter); 00050 00051 typedef SmartPointer<Self> Pointer; 00052 typedef SmartPointer<const Self> ConstPointer; 00053 00055 itkNewMacro(Self); 00056 00057 virtual ~VanHerkGilWermanDilateImageFilter() {} 00058 00059 protected: 00060 00061 typedef typename TImage::PixelType PixelType; 00062 00063 VanHerkGilWermanDilateImageFilter() 00064 { 00065 this->m_Boundary = NumericTraits< PixelType >::NonpositiveMin(); 00066 } 00067 00068 void PrintSelf(std::ostream& os, Indent indent) const 00069 { 00070 os << indent << "VanHerkGilWerman erosion: " << std::endl; 00071 } 00072 00073 private: 00074 00075 VanHerkGilWermanDilateImageFilter(const Self&); //purposely not implemented 00076 void operator=(const Self&); //purposely not implemented 00077 00078 }; 00079 00080 00081 } // namespace itk 00082 00083 #endif 00084