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);
00048
00050 typedef TInputImage InputImageType;
00051 typedef TOutputImage OutputImageType;
00052
00054 typedef VotingBinaryHoleFillingImageFilter Self;
00055 typedef VotingBinaryImageFilter< InputImageType, OutputImageType> Superclass;
00056 typedef SmartPointer<Self> Pointer;
00057 typedef SmartPointer<const Self> ConstPointer;
00058
00060 itkNewMacro(Self);
00061
00063 itkTypeMacro(VotingBinaryHoleFillingImageFilter, VotingBinaryImageFilter);
00064
00066 typedef typename InputImageType::PixelType InputPixelType;
00067 typedef typename OutputImageType::PixelType OutputPixelType;
00068
00069 typedef typename InputImageType::RegionType InputImageRegionType;
00070 typedef typename OutputImageType::RegionType OutputImageRegionType;
00071
00072 typedef typename InputImageType::SizeType InputSizeType;
00073
00074
00081 itkGetConstReferenceMacro( MajorityThreshold, unsigned int );
00082 itkSetMacro( MajorityThreshold, unsigned int );
00083
00084
00086 itkGetConstReferenceMacro( NumberOfPixelsChanged, unsigned int );
00087
00088 protected:
00089 VotingBinaryHoleFillingImageFilter();
00090 virtual ~VotingBinaryHoleFillingImageFilter() {}
00091 void PrintSelf(std::ostream& os, Indent indent) const;
00092
00096 void SetBirthThreshold( const InputPixelType value )
00097 { this->Superclass::SetBirthThreshold( value ); }
00098 void SetSurvivalThreshold( const InputPixelType value )
00099 { this->Superclass::SetSurvivalThreshold( value ); }
00100
00101
00112 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00113 int threadId );
00114
00117 void BeforeThreadedGenerateData();
00118 void AfterThreadedGenerateData();
00119
00120 private:
00121 VotingBinaryHoleFillingImageFilter(const Self&);
00122 void operator=(const Self&);
00123
00124 unsigned int m_MajorityThreshold;
00125
00126 unsigned int m_NumberOfPixelsChanged;
00127
00128
00129 Array<unsigned int> m_Count;
00130 };
00131
00132 }
00133
00134 #ifndef ITK_MANUAL_INSTANTIATION
00135 #include "itkVotingBinaryHoleFillingImageFilter.txx"
00136 #endif
00137
00138 #endif