ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkBinaryDilateImageFilter.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 __itkBinaryDilateImageFilter_h
00019 #define __itkBinaryDilateImageFilter_h
00020 
00021 #include <vector>
00022 #include <queue>
00023 #include "itkBinaryMorphologyImageFilter.h"
00024 #include "itkConstNeighborhoodIterator.h"
00025 
00026 namespace itk
00027 {
00065 template< class TInputImage, class TOutputImage, class TKernel >
00066 class ITK_EXPORT BinaryDilateImageFilter:
00067   public BinaryMorphologyImageFilter< TInputImage, TOutputImage, TKernel >
00068 {
00069 public:
00070 
00072   itkStaticConstMacro(InputImageDimension, unsigned int,
00073                       TInputImage::ImageDimension);
00074   itkStaticConstMacro(OutputImageDimension, unsigned int,
00075                       TOutputImage::ImageDimension);
00077 
00079   itkStaticConstMacro(KernelDimension, unsigned int,
00080                       TKernel::NeighborhoodDimension);
00081 
00083   typedef TInputImage  InputImageType;
00084   typedef TOutputImage OutputImageType;
00085   typedef TKernel      KernelType;
00086 
00088   typedef BinaryDilateImageFilter Self;
00089   typedef BinaryMorphologyImageFilter< InputImageType, OutputImageType,
00090                                        KernelType > Superclass;
00091 
00092   typedef SmartPointer< Self >       Pointer;
00093   typedef SmartPointer< const Self > ConstPointer;
00094 
00096   itkNewMacro(Self);
00097 
00099   itkTypeMacro(BinaryDilateImageFilter, BinaryMorphologyImageFilter);
00100 
00102   typedef typename KernelType::ConstIterator KernelIteratorType;
00103 
00105   typedef typename InputImageType::PixelType                 InputPixelType;
00106   typedef typename OutputImageType::PixelType                OutputPixelType;
00107   typedef typename NumericTraits< InputPixelType >::RealType InputRealType;
00108   typedef typename InputImageType::OffsetType                OffsetType;
00109   typedef typename InputImageType::IndexType                 IndexType;
00110 
00111   typedef typename InputImageType::RegionType  InputImageRegionType;
00112   typedef typename OutputImageType::RegionType OutputImageRegionType;
00113   typedef typename InputImageType::SizeType    InputSizeType;
00114 
00118   void SetDilateValue(const InputPixelType & value)
00119   { this->SetForegroundValue(value); }
00120 
00124   InputPixelType GetDilateValue() const
00125   { return this->GetForegroundValue(); }
00126 protected:
00127   BinaryDilateImageFilter();
00128   virtual ~BinaryDilateImageFilter(){}
00129   void PrintSelf(std::ostream & os, Indent indent) const;
00131 
00132   void GenerateData();
00133 
00134   // type inherited from the superclass
00135   typedef typename Superclass::NeighborIndexContainer NeighborIndexContainer;
00136 private:
00137   BinaryDilateImageFilter(const Self &); //purposely not implemented
00138   void operator=(const Self &);          //purposely not implemented
00139 };
00140 } // end namespace itk
00141 
00142 #ifndef ITK_MANUAL_INSTANTIATION
00143 #include "itkBinaryDilateImageFilter.hxx"
00144 #endif
00145 
00146 #endif
00147