ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkVotingBinaryIterativeHoleFillingImageFilter.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 __itkVotingBinaryIterativeHoleFillingImageFilter_h
00019 #define __itkVotingBinaryIterativeHoleFillingImageFilter_h
00020 
00021 #include "itkVotingBinaryHoleFillingImageFilter.h"
00022 
00023 namespace itk
00024 {
00054 template< class TImage >
00055 class ITK_EXPORT VotingBinaryIterativeHoleFillingImageFilter:
00056   public ImageToImageFilter< TImage, TImage >
00057 {
00058 public:
00059 
00061   typedef TImage InputImageType;
00062   typedef TImage OutputImageType;
00063 
00065   typedef VotingBinaryIterativeHoleFillingImageFilter           Self;
00066   typedef ImageToImageFilter< InputImageType, OutputImageType > Superclass;
00067   typedef SmartPointer< Self >                                  Pointer;
00068   typedef SmartPointer< const Self >                            ConstPointer;
00069 
00071   itkNewMacro(Self);
00072 
00074   itkTypeMacro(VotingBinaryIterativeHoleFillingImageFilter, ImageToImageFilter);
00075 
00078   typedef VotingBinaryHoleFillingImageFilter<
00079     InputImageType,
00080     OutputImageType
00081     > VotingFilterType;
00082 
00084   typedef typename InputImageType::PixelType  InputPixelType;
00085   typedef typename OutputImageType::PixelType OutputPixelType;
00086 
00087   typedef typename InputImageType::RegionType  InputImageRegionType;
00088   typedef typename OutputImageType::RegionType OutputImageRegionType;
00089 
00090   typedef typename InputImageType::SizeType InputSizeType;
00091 
00095   itkGetConstReferenceMacro(MaximumNumberOfIterations, unsigned int);
00096   itkSetMacro(MaximumNumberOfIterations, unsigned int);
00098 
00102   itkGetConstReferenceMacro(CurrentNumberOfIterations, unsigned int);
00103   itkSetMacro(CurrentNumberOfIterations, unsigned int);
00105 
00107   itkSetMacro(Radius, InputSizeType);
00108 
00110   itkGetConstReferenceMacro(Radius, InputSizeType);
00111 
00114   itkSetMacro(BackgroundValue, InputPixelType);
00115   itkSetMacro(ForegroundValue, InputPixelType);
00117 
00120   itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
00121   itkGetConstReferenceMacro(ForegroundValue, InputPixelType);
00123 
00130   itkGetConstReferenceMacro(MajorityThreshold, unsigned int);
00131   itkSetMacro(MajorityThreshold, unsigned int);
00133 
00135   itkGetConstReferenceMacro(NumberOfPixelsChanged, unsigned int);
00136 
00137 #ifdef ITK_USE_CONCEPT_CHECKING
00138 
00139   itkConceptMacro( InputEqualityComparableCheck,
00140                    ( Concept::EqualityComparable< InputPixelType > ) );
00141   itkConceptMacro( InputOStreamWritableeCheck,
00142                    ( Concept::OStreamWritable< InputPixelType > ) );
00143 
00145 #endif
00146 protected:
00147   VotingBinaryIterativeHoleFillingImageFilter();
00148   virtual ~VotingBinaryIterativeHoleFillingImageFilter() {}
00149   void PrintSelf(std::ostream & os, Indent indent) const;
00151 
00155   void GenerateData();
00156 
00157 private:
00158   VotingBinaryIterativeHoleFillingImageFilter(const Self &); //purposely not
00159                                                              // implemented
00160   void operator=(const Self &);                              //purposely not
00161 
00162   // implemented
00163 
00164   InputSizeType m_Radius;
00165 
00166   InputPixelType m_ForegroundValue;
00167   InputPixelType m_BackgroundValue;
00168 
00169   unsigned int m_MaximumNumberOfIterations;
00170   unsigned int m_CurrentNumberOfIterations;
00171   unsigned int m_MajorityThreshold;
00172   unsigned int m_NumberOfPixelsChanged;
00173 };
00174 } // end namespace itk
00175 
00176 #ifndef ITK_MANUAL_INSTANTIATION
00177 #include "itkVotingBinaryIterativeHoleFillingImageFilter.hxx"
00178 #endif
00179 
00180 #endif
00181