00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkVotingBinaryImageFilter_h
00018 #define __itkVotingBinaryImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkImage.h"
00022
00023 namespace itk
00024 {
00036 template <class TInputImage, class TOutputImage>
00037 class ITK_EXPORT VotingBinaryImageFilter :
00038 public ImageToImageFilter< TInputImage, TOutputImage >
00039 {
00040 public:
00042 itkStaticConstMacro(InputImageDimension, unsigned int,
00043 TInputImage::ImageDimension);
00044 itkStaticConstMacro(OutputImageDimension, unsigned int,
00045 TOutputImage::ImageDimension);
00046
00048 typedef TInputImage InputImageType;
00049 typedef TOutputImage OutputImageType;
00050
00052 typedef VotingBinaryImageFilter Self;
00053 typedef ImageToImageFilter< InputImageType, OutputImageType> Superclass;
00054 typedef SmartPointer<Self> Pointer;
00055 typedef SmartPointer<const Self> ConstPointer;
00056
00058 itkNewMacro(Self);
00059
00061 itkTypeMacro(VotingBinaryImageFilter, ImageToImageFilter);
00062
00064 typedef typename InputImageType::PixelType InputPixelType;
00065 typedef typename OutputImageType::PixelType OutputPixelType;
00066
00067 typedef typename InputImageType::RegionType InputImageRegionType;
00068 typedef typename OutputImageType::RegionType OutputImageRegionType;
00069
00070 typedef typename InputImageType::SizeType InputSizeType;
00071
00073 itkSetMacro(Radius, InputSizeType);
00074
00076 itkGetConstReferenceMacro(Radius, InputSizeType);
00077
00080 itkSetMacro(BackgroundValue, InputPixelType);
00081 itkSetMacro(ForegroundValue, InputPixelType);
00082
00085 itkGetConstReferenceMacro(BackgroundValue, InputPixelType);
00086 itkGetConstReferenceMacro(ForegroundValue, InputPixelType);
00087
00090 itkGetConstReferenceMacro(BirthThreshold, InputPixelType);
00091 itkSetMacro(BirthThreshold, InputPixelType);
00092
00095 itkGetConstReferenceMacro(SurvivalThreshold, InputPixelType);
00096 itkSetMacro(SurvivalThreshold, InputPixelType);
00097
00104 virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError);
00105
00106 protected:
00107 VotingBinaryImageFilter();
00108 virtual ~VotingBinaryImageFilter() {}
00109 void PrintSelf(std::ostream& os, Indent indent) const;
00110
00121 void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
00122 int threadId );
00123
00124 private:
00125 VotingBinaryImageFilter(const Self&);
00126 void operator=(const Self&);
00127
00128 InputSizeType m_Radius;
00129
00130 InputPixelType m_ForegroundValue;
00131 InputPixelType m_BackgroundValue;
00132
00133 InputPixelType m_BirthThreshold;
00134 InputPixelType m_SurvivalThreshold;
00135 };
00136
00137 }
00138
00139 #ifndef ITK_MANUAL_INSTANTIATION
00140 #include "itkVotingBinaryImageFilter.txx"
00141 #endif
00142
00143 #endif