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 __itkBinaryThinningImageFilter_h 00019 #define __itkBinaryThinningImageFilter_h 00020 00021 #include "itkNeighborhoodIterator.h" 00022 #include "itkImageToImageFilter.h" 00023 #include "itkImageRegionIteratorWithIndex.h" 00024 00025 namespace itk 00026 { 00060 template< class TInputImage, class TOutputImage > 00061 class ITK_EXPORT BinaryThinningImageFilter: 00062 public ImageToImageFilter< TInputImage, TOutputImage > 00063 { 00064 public: 00066 typedef BinaryThinningImageFilter Self; 00067 typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass; 00068 typedef SmartPointer< Self > Pointer; 00069 typedef SmartPointer< const Self > ConstPointer; 00070 00072 itkNewMacro(Self); 00073 00075 itkTypeMacro(BinaryThinningImageFilter, ImageToImageFilter); 00076 00078 typedef TInputImage InputImageType; 00079 00081 typedef TOutputImage OutputImageType; 00082 00084 typedef typename InputImageType::RegionType RegionType; 00085 00087 typedef typename RegionType::IndexType IndexType; 00088 00090 typedef typename InputImageType::PixelType PixelType; 00091 00093 typedef typename RegionType::SizeType SizeType; 00094 00096 typedef typename InputImageType::ConstPointer InputImagePointer; 00097 00099 typedef typename OutputImageType::Pointer OutputImagePointer; 00100 00102 typedef typename Superclass::OutputImagePixelType OutputImagePixelType; 00103 00105 typedef NeighborhoodIterator< TInputImage > NeighborhoodIteratorType; 00106 00108 OutputImageType * GetThinning(void); 00109 00111 itkStaticConstMacro(InputImageDimension, unsigned int, 00112 TInputImage::ImageDimension); 00113 itkStaticConstMacro(OutputImageDimension, unsigned int, 00114 TOutputImage::ImageDimension); 00116 00117 #ifdef ITK_USE_CONCEPT_CHECKING 00118 00119 itkConceptMacro( SameDimensionCheck, 00120 ( Concept::SameDimension< InputImageDimension, OutputImageDimension > ) ); 00121 itkConceptMacro( InputAdditiveOperatorsCheck, 00122 ( Concept::AdditiveOperators< PixelType > ) ); 00123 itkConceptMacro( InputConvertibleToIntCheck, 00124 ( Concept::Convertible< PixelType, int > ) ); 00125 itkConceptMacro( IntConvertibleToInputCheck, 00126 ( Concept::Convertible< int, PixelType > ) ); 00127 itkConceptMacro( SameTypeCheck, 00128 ( Concept::SameType< PixelType, typename TOutputImage::PixelType > ) ); 00129 00131 #endif 00132 protected: 00133 BinaryThinningImageFilter(); 00134 virtual ~BinaryThinningImageFilter() {} 00135 00137 void GenerateData(); 00138 00140 void PrepareData(); 00141 00143 void ComputeThinImage(); 00144 00145 private: 00146 BinaryThinningImageFilter(const Self &); //purposely not implemented 00147 void operator=(const Self &); //purposely not implemented 00148 }; // end of BinaryThinningImageFilter 00149 // class 00150 } //end namespace itk 00151 00152 #ifndef ITK_MANUAL_INSTANTIATION 00153 #include "itkBinaryThinningImageFilter.hxx" 00154 #endif 00155 00156 #endif 00157