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