ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkBasicErodeImageFilter.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 __itkBasicErodeImageFilter_h
00019 #define __itkBasicErodeImageFilter_h
00020 
00021 #include "itkMorphologyImageFilter.h"
00022 
00023 namespace itk
00024 {
00045 template< class TInputImage, class TOutputImage, class TKernel >
00046 class ITK_EXPORT BasicErodeImageFilter:
00047   public MorphologyImageFilter< TInputImage, TOutputImage, TKernel >
00048 {
00049 public:
00051   typedef BasicErodeImageFilter                                       Self;
00052   typedef MorphologyImageFilter< TInputImage, TOutputImage, TKernel > Superclass;
00053   typedef SmartPointer< Self >                                        Pointer;
00054   typedef SmartPointer< const Self >                                  ConstPointer;
00055 
00057   itkNewMacro(Self);
00058 
00060   itkTypeMacro(BasicErodeImageFilter,
00061                MorphologyImageFilter);
00062 
00064   typedef typename Superclass::PixelType PixelType;
00065 
00067   typedef typename Superclass::KernelIteratorType KernelIteratorType;
00068 
00070   typedef typename Superclass::NeighborhoodIteratorType NeighborhoodIteratorType;
00071 
00073   typedef typename Superclass::KernelType KernelType;
00074 
00076   typedef typename Superclass::DefaultBoundaryConditionType DefaultBoundaryConditionType;
00077 
00079   itkStaticConstMacro(InputImageDimension, unsigned int,
00080                       TInputImage::ImageDimension);
00081   itkStaticConstMacro(OutputImageDimension, unsigned int,
00082                       TOutputImage::ImageDimension);
00083   itkStaticConstMacro(KernelDimension, unsigned int,
00084                       TKernel::NeighborhoodDimension);
00086 
00088   typedef typename TKernel::PixelType KernelPixelType;
00089 
00090 #ifdef ITK_USE_CONCEPT_CHECKING
00091 
00092   itkConceptMacro( InputConvertibleToOutputCheck,
00093                    ( Concept::Convertible< PixelType, typename TOutputImage::PixelType > ) );
00094   itkConceptMacro( SameDimensionCheck1,
00095                    ( Concept::SameDimension< InputImageDimension, OutputImageDimension > ) );
00096   itkConceptMacro( SameDimensionCheck2,
00097                    ( Concept::SameDimension< InputImageDimension, KernelDimension > ) );
00098   itkConceptMacro( InputLessThanComparableCheck,
00099                    ( Concept::LessThanComparable< PixelType > ) );
00100   itkConceptMacro( KernelGreaterThanComparableCheck,
00101                    ( Concept::GreaterThanComparable< KernelPixelType > ) );
00102 
00104 #endif
00105 protected:
00106   BasicErodeImageFilter();
00107   ~BasicErodeImageFilter() {}
00108 
00115   virtual PixelType Evaluate(const NeighborhoodIteratorType & nit,
00116                              const KernelIteratorType kernelBegin,
00117                              const KernelIteratorType kernelEnd);
00118 
00119 private:
00120   BasicErodeImageFilter(const Self &); //purposely not implemented
00121   void operator=(const Self &);        //purposely not implemented
00122 
00123   // Default boundary condition for erosion filter, defaults to
00124   // NumericTraits<PixelType>::max()
00125   DefaultBoundaryConditionType m_ErodeBoundaryCondition;
00126 }; // end of class
00127 } // end namespace itk
00128 
00129 #ifndef ITK_MANUAL_INSTANTIATION
00130 #include "itkBasicErodeImageFilter.hxx"
00131 #endif
00132 
00133 #endif
00134