ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkVanHerkGilWermanErodeImageFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkVanHerkGilWermanErodeImageFilter_h
00019 #define __itkVanHerkGilWermanErodeImageFilter_h
00020 
00021 // Intentionally include the Dilate filter to get the base class to avoid issues
00022 // with itkFlatStructuringElement.hxx
00023 #include "itkVanHerkGilWermanDilateImageFilter.h"
00024 
00025 namespace itk
00026 {
00027 template< class TPixel >
00028 class MinFunctor
00029 {
00030 public:
00031   MinFunctor(){}
00032   ~MinFunctor(){}
00033   inline TPixel operator()(const TPixel & A, const TPixel & B) const
00034   {
00035     return vnl_math_min(A, B);
00036   }
00037 };
00038 
00039 template< class TImage, class TKernel >
00040 class ITK_EXPORT VanHerkGilWermanErodeImageFilter:
00041   public VanHerkGilWermanErodeDilateImageFilter< TImage, TKernel, MinFunctor< typename TImage::PixelType > >
00042 
00043 {
00044 public:
00045   typedef VanHerkGilWermanErodeImageFilter Self;
00046   typedef VanHerkGilWermanErodeDilateImageFilter< TImage, TKernel,
00047                                                   MinFunctor< typename TImage::PixelType > > Superclass;
00048 
00050   itkTypeMacro(VanHerkGilWermanErodeImageFilter,
00051                VanHerkGilWermanErodeDilateImageFilter);
00052 
00053   typedef SmartPointer< Self >       Pointer;
00054   typedef SmartPointer< const Self > ConstPointer;
00055   typedef typename TImage::PixelType PixelType;
00056 
00058   itkNewMacro(Self);
00059 
00060 protected:
00061 
00062   VanHerkGilWermanErodeImageFilter()
00063   {
00064     this->m_Boundary = NumericTraits< PixelType >::max();
00065   }
00066   virtual ~VanHerkGilWermanErodeImageFilter() {}
00067 
00068 private:
00069 
00070   VanHerkGilWermanErodeImageFilter(const Self &); //purposely not implemented
00071   void operator=(const Self &);                   //purposely not implemented
00072 };
00073 } // namespace itk
00074 
00075 #endif
00076