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
00022 namespace itk
00023 {
00037 template <class TInputImage, class TOutputImage>
00038 class ITK_EXPORT VotingBinaryHoleFillingImageFilter :
00039 public VotingBinaryImageFilter< TInputImage, TOutputImage >
00040 {
00041 public:
00043 itkStaticConstMacro(InputImageDimension, unsigned int,
00044 TInputImage::ImageDimension);
00045 itkStaticConstMacro(OutputImageDimension, unsigned int,
00046 TOutputImage::ImageDimension);
00047
00049 typedef TInputImage InputImageType;
00050 typedef TOutputImage OutputImageType;
00051
00053 typedef VotingBinaryHoleFillingImageFilter Self;
00054 typedef VotingBinaryImageFilter< InputImageType, OutputImageType> Superclass;
00055 typedef SmartPointer<Self> Pointer;
00056 typedef SmartPointer<const Self> ConstPointer;
00057
00059 itkNewMacro(Self);
00060
00062 itkTypeMacro(VotingBinaryHoleFillingImageFilter, VotingBinaryImageFilter);
00063
00065 typedef typename InputImageType::PixelType InputPixelType;
00066 typedef typename OutputImageType::PixelType OutputPixelType;
00067
00068 typedef typename InputImageType::RegionType InputImageRegionType;
00069 typedef typename OutputImageType::RegionType OutputImageRegionType;
00070
00071 typedef typename InputImageType::SizeType InputSizeType;
00072
00073
00080 itkGetConstReferenceMacro( MajorityThreshold, unsigned int );
00081 itkSetMacro( MajorityThreshold, unsigned int );
00082
00083
00085 itkGetConstReferenceMacro( NumberOfPixelsChanged, unsigned int );
00086
00087 protected:
00088 VotingBinaryHoleFillingImageFilter();
00089 virtual ~VotingBinaryHoleFillingImageFilter() {}
00090 void PrintSelf(std::ostream& os, Indent indent) const;
00091
00095 void SetBirthThreshold( const InputPixelType value )
00096 { this->Superclass::SetBirthThreshold( value ); }
00097 void SetSurvivalThreshold( const InputPixelType value )
00098 { this->Superclass::SetSurvivalThreshold( value ); }
00099
00100
00111 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00112 int threadId );
00113
00116 void BeforeThreadedGenerateData();
00117 void AfterThreadedGenerateData();
00118
00119 private:
00120 VotingBinaryHoleFillingImageFilter(const Self&);
00121 void operator=(const Self&);
00122
00123 unsigned int m_MajorityThreshold;
00124
00125 unsigned int m_NumberOfPixelsChanged;
00126
00127
00128 Array<unsigned int> m_Count;
00129 };
00130
00131 }
00132
00133 #ifndef ITK_MANUAL_INSTANTIATION
00134 #include "itkVotingBinaryHoleFillingImageFilter.txx"
00135 #endif
00136
00137 #endif