00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkVotingBinaryHoleFillingImageFilter_h
00018 #define __itkVotingBinaryHoleFillingImageFilter_h
00019
00020 #include "itkVotingBinaryImageFilter.h"
00021 #include "itkArray.h"
00022
00023 namespace itk
00024 {
00038 template <class TInputImage, class TOutputImage>
00039 class ITK_EXPORT VotingBinaryHoleFillingImageFilter :
00040 public VotingBinaryImageFilter< TInputImage, TOutputImage >
00041 {
00042 public:
00044 itkStaticConstMacro(InputImageDimension, unsigned int,
00045 TInputImage::ImageDimension);
00046 itkStaticConstMacro(OutputImageDimension, unsigned int,
00047 TOutputImage::ImageDimension);
00049
00051 typedef TInputImage InputImageType;
00052 typedef TOutputImage OutputImageType;
00053
00055 typedef VotingBinaryHoleFillingImageFilter Self;
00056 typedef VotingBinaryImageFilter< InputImageType, OutputImageType> Superclass;
00057 typedef SmartPointer<Self> Pointer;
00058 typedef SmartPointer<const Self> ConstPointer;
00059
00061 itkNewMacro(Self);
00062
00064 itkTypeMacro(VotingBinaryHoleFillingImageFilter, VotingBinaryImageFilter);
00065
00067 typedef typename InputImageType::PixelType InputPixelType;
00068 typedef typename OutputImageType::PixelType OutputPixelType;
00069
00070 typedef typename InputImageType::RegionType InputImageRegionType;
00071 typedef typename OutputImageType::RegionType OutputImageRegionType;
00072
00073 typedef typename InputImageType::SizeType InputSizeType;
00074
00075
00082 itkGetConstReferenceMacro( MajorityThreshold, unsigned int );
00083 itkSetMacro( MajorityThreshold, unsigned int );
00085
00086
00088 itkGetConstReferenceMacro( NumberOfPixelsChanged, unsigned int );
00089
00090 #ifdef ITK_USE_CONCEPT_CHECKING
00091
00092 itkConceptMacro(IntConvertibleToInputCheck,
00093 (Concept::Convertible<int, InputPixelType>));
00094 itkConceptMacro(UnsignedIntConvertibleToInputCheck,
00095 (Concept::Convertible<unsigned int, InputPixelType>));
00096
00098 #endif
00099
00100 protected:
00101 VotingBinaryHoleFillingImageFilter();
00102 virtual ~VotingBinaryHoleFillingImageFilter() {}
00103 void PrintSelf(std::ostream& os, Indent indent) const;
00104
00108 void SetBirthThreshold( const InputPixelType value )
00109 { this->Superclass::SetBirthThreshold( value ); }
00110 void SetSurvivalThreshold( const InputPixelType value )
00111 { this->Superclass::SetSurvivalThreshold( value ); }
00113
00114
00125 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00126 int threadId );
00127
00130 void BeforeThreadedGenerateData();
00131 void AfterThreadedGenerateData();
00133
00134 private:
00135 VotingBinaryHoleFillingImageFilter(const Self&);
00136 void operator=(const Self&);
00137
00138 unsigned int m_MajorityThreshold;
00139
00140 unsigned int m_NumberOfPixelsChanged;
00141
00142
00143 Array<unsigned int> m_Count;
00144 };
00145
00146 }
00147
00148 #ifndef ITK_MANUAL_INSTANTIATION
00149 #include "itkVotingBinaryHoleFillingImageFilter.txx"
00150 #endif
00151
00152 #endif
00153