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 __itkErodeObjectMorphologyImageFilter_h 00019 #define __itkErodeObjectMorphologyImageFilter_h 00020 00021 #include "itkObjectMorphologyImageFilter.h" 00022 00023 namespace itk 00024 { 00045 template< class TInputImage, class TOutputImage, class TKernel > 00046 class ITK_EXPORT ErodeObjectMorphologyImageFilter: 00047 public ObjectMorphologyImageFilter< TInputImage, TOutputImage, TKernel > 00048 { 00049 public: 00051 typedef ErodeObjectMorphologyImageFilter Self; 00052 typedef ObjectMorphologyImageFilter< TInputImage, TOutputImage, TKernel > Superclass; 00053 typedef SmartPointer< Self > Pointer; 00054 typedef SmartPointer< const Self > ConstPointer; 00055 00057 itkNewMacro(Self); 00058 00060 itkTypeMacro(ErodeObjectMorphologyImageFilter, ObjectMorphologyImageFilter); 00061 00063 typedef typename Superclass::PixelType PixelType; 00064 00066 typedef TKernel KernelType; 00067 00069 typedef typename KernelType::ConstIterator KernelIteratorType; 00070 00071 typedef NeighborhoodIterator< TOutputImage > OutputNeighborhoodIteratorType; 00072 00074 typedef typename Superclass::DefaultBoundaryConditionType 00075 DefaultBoundaryConditionType; 00076 00079 void SetErodeValue(PixelType objectValue) 00080 { 00081 this->SetObjectValue(objectValue); 00082 } 00083 00086 PixelType GetErodeValue(void) 00087 { 00088 return this->GetObjectValue(); 00089 } 00090 00092 itkSetMacro(BackgroundValue, PixelType); 00093 00095 itkGetConstMacro(BackgroundValue, PixelType); 00096 00098 typedef typename TKernel::PixelType KernelPixelType; 00099 00100 #ifdef ITK_USE_CONCEPT_CHECKING 00101 00102 itkConceptMacro( KernelGreaterThanComparableCheck, 00103 ( Concept::GreaterThanComparable< KernelPixelType > ) ); 00104 00106 #endif 00107 protected: 00108 ErodeObjectMorphologyImageFilter(); 00109 ~ErodeObjectMorphologyImageFilter() {} 00110 void PrintSelf(std::ostream & os, Indent indent) const; 00112 00117 void Evaluate(OutputNeighborhoodIteratorType & nit, 00118 const KernelType & kernel); 00119 00120 private: 00121 ErodeObjectMorphologyImageFilter(const Self &); //purposely not implemented 00122 void operator=(const Self &); //purposely not implemented 00123 00124 PixelType m_BackgroundValue; 00125 00126 // Default boundary condition for erosion filter, defaults to 00127 // NumericTraits<PixelType>::max() 00128 DefaultBoundaryConditionType m_ErodeBoundaryCondition; 00129 }; // end of class 00130 } // end namespace itk 00131 00132 #ifndef ITK_MANUAL_INSTANTIATION 00133 #include "itkErodeObjectMorphologyImageFilter.hxx" 00134 #endif 00135 00136 #endif 00137