ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkBinaryPruningImageFilter.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 __itkBinaryPruningImageFilter_h
00019 #define __itkBinaryPruningImageFilter_h
00020 
00021 #include "itkImageToImageFilter.h"
00022 #include "itkImageRegionIteratorWithIndex.h"
00023 #include "itkNeighborhoodIterator.h"
00024 
00025 namespace itk
00026 {
00053 template< class TInputImage, class TOutputImage >
00054 class ITK_EXPORT BinaryPruningImageFilter:
00055   public ImageToImageFilter< TInputImage, TOutputImage >
00056 {
00057 public:
00059   typedef BinaryPruningImageFilter                        Self;
00060   typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass;
00061   typedef SmartPointer< Self >                            Pointer;
00062   typedef SmartPointer< const Self >                      ConstPointer;
00063 
00065   itkNewMacro(Self);
00066 
00068   itkTypeMacro(BinaryPruningImageFilter, ImageToImageFilter);
00069 
00071   typedef   TInputImage InputImageType;
00072 
00074   typedef   TOutputImage OutputImageType;
00075 
00077   typedef typename InputImageType::RegionType RegionType;
00078 
00080   typedef typename RegionType::IndexType IndexType;
00081 
00083   typedef typename InputImageType::PixelType PixelType;
00084 
00086   typedef typename RegionType::SizeType SizeType;
00087 
00089   typedef typename InputImageType::ConstPointer InputImagePointer;
00090 
00092   typedef typename OutputImageType::Pointer OutputImagePointer;
00093 
00095   typedef NeighborhoodIterator< TInputImage > NeighborhoodIteratorType;
00096 
00098   OutputImageType * GetPruning(void);
00099 
00101   itkSetMacro(Iteration, unsigned int);
00102   itkGetConstMacro(Iteration, unsigned int);
00104 
00106   itkStaticConstMacro(InputImageDimension, unsigned int,
00107                       TInputImage::ImageDimension);
00108   itkStaticConstMacro(OutputImageDimension, unsigned int,
00109                       TOutputImage::ImageDimension);
00111 
00112 #ifdef ITK_USE_CONCEPT_CHECKING
00113 
00114   itkConceptMacro( SameDimensionCheck,
00115                    ( Concept::SameDimension< InputImageDimension, OutputImageDimension > ) );
00116   itkConceptMacro( SameTypeCheck,
00117                    ( Concept::SameType< PixelType, typename TOutputImage::PixelType > ) );
00118   itkConceptMacro( AdditiveOperatorsCheck,
00119                    ( Concept::AdditiveOperators< PixelType > ) );
00120   itkConceptMacro( IntConvertibleToPixelTypeCheck,
00121                    ( Concept::Convertible< int, PixelType > ) );
00122   itkConceptMacro( PixelLessThanIntCheck,
00123                    ( Concept::LessThanComparable< PixelType, int > ) );
00124 
00126 #endif
00127 protected:
00128   BinaryPruningImageFilter();
00129   virtual ~BinaryPruningImageFilter() {}
00130   void PrintSelf(std::ostream & os, Indent indent) const;
00132 
00134   void GenerateData();
00135 
00137   void PrepareData();
00138 
00140   void ComputePruneImage();
00141 
00142 private:
00143   BinaryPruningImageFilter(const Self &); //purposely not implemented
00144   void operator=(const Self &);           //purposely not implemented
00145 
00146   unsigned int m_Iteration;
00147 }; // end of BinaryThinningImageFilter class
00148 } //end namespace itk
00149 
00150 #ifndef ITK_MANUAL_INSTANTIATION
00151 #include "itkBinaryPruningImageFilter.hxx"
00152 #endif
00153 
00154 #endif
00155