ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkAnchorErodeDilateImageFilter.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 __itkAnchorErodeDilateImageFilter_h
00019 #define __itkAnchorErodeDilateImageFilter_h
00020 
00021 #include "itkKernelImageFilter.h"
00022 #include "itkProgressReporter.h"
00023 #include "itkAnchorErodeDilateLine.h"
00024 #include "itkBresenhamLine.h"
00025 
00026 namespace itk
00027 {
00038 template< class TImage, class TKernel,
00039           class TFunction1 >
00040 class ITK_EXPORT AnchorErodeDilateImageFilter:
00041   public KernelImageFilter< TImage, TImage, TKernel >
00042 {
00043 public:
00044 
00046   typedef AnchorErodeDilateImageFilter         Self;
00047   typedef KernelImageFilter< TImage, TImage, TKernel >
00048                                                Superclass;
00049   typedef SmartPointer< Self >                 Pointer;
00050   typedef SmartPointer< const Self >           ConstPointer;
00051 
00055   typedef TKernel KernelType;
00056 
00057   typedef TImage                                InputImageType;
00058   typedef typename InputImageType::Pointer      InputImagePointer;
00059   typedef typename InputImageType::ConstPointer InputImageConstPointer;
00060   typedef typename InputImageType::RegionType   InputImageRegionType;
00061   typedef typename InputImageType::PixelType    InputImagePixelType;
00062   typedef typename TImage::IndexType            IndexType;
00063   typedef typename TImage::SizeType             SizeType;
00064 
00066   itkStaticConstMacro(InputImageDimension, unsigned int,
00067                       TImage::ImageDimension);
00068   itkStaticConstMacro(OutputImageDimension, unsigned int,
00069                       TImage::ImageDimension);
00071 
00073   itkNewMacro(Self);
00074 
00076   itkTypeMacro(AnchorErodeDilateImageFilter,
00077                KernelImageFilter);
00078 
00080   itkSetMacro(Boundary, InputImagePixelType);
00081   itkGetConstMacro(Boundary, InputImagePixelType);
00082 protected:
00083   AnchorErodeDilateImageFilter();
00084   ~AnchorErodeDilateImageFilter() {}
00085   void PrintSelf(std::ostream & os, Indent indent) const;
00087 
00089   void  ThreadedGenerateData(const InputImageRegionType & outputRegionForThread,
00090                              ThreadIdType threadId);
00091 
00092   // should be set by the meta filter
00093   InputImagePixelType m_Boundary;
00094 private:
00095   AnchorErodeDilateImageFilter(const Self &); //purposely not implemented
00096   void operator=(const Self &);               //purposely not implemented
00097 
00098   typedef BresenhamLine< itkGetStaticConstMacro(InputImageDimension) > BresType;
00099 
00100   // the class that operates on lines
00101   typedef AnchorErodeDilateLine< InputImagePixelType, TFunction1 > AnchorLineType;
00102 }; // end of class
00103 } // end namespace itk
00104 
00105 #ifndef ITK_MANUAL_INSTANTIATION
00106 #include "itkAnchorErodeDilateImageFilter.hxx"
00107 #endif
00108 
00109 #endif
00110