00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkOtsuMultipleThresholdsImageFilter_h
00018 #define __itkOtsuMultipleThresholdsImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkFixedArray.h"
00022
00023 namespace itk {
00024
00043 template<class TInputImage, class TOutputImage>
00044 class ITK_EXPORT OtsuMultipleThresholdsImageFilter :
00045 public ImageToImageFilter<TInputImage, TOutputImage>
00046 {
00047 public:
00049 typedef OtsuMultipleThresholdsImageFilter Self;
00050 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00051 typedef SmartPointer<Self> Pointer;
00052 typedef SmartPointer<const Self> ConstPointer;
00053
00055 itkNewMacro(Self);
00056
00058 itkTypeMacro(OtsuMultipleThresholdsImageFilter, ImageToImageFilter);
00059
00061 typedef typename TInputImage::PixelType InputPixelType;
00062 typedef typename TOutputImage::PixelType OutputPixelType;
00063
00065 typedef typename TInputImage::Pointer InputImagePointer;
00066 typedef typename TOutputImage::Pointer OutputImagePointer;
00067
00068 typedef typename TInputImage::SizeType InputSizeType;
00069 typedef typename TInputImage::IndexType InputIndexType;
00070 typedef typename TInputImage::RegionType InputImageRegionType;
00071 typedef typename TOutputImage::SizeType OutputSizeType;
00072 typedef typename TOutputImage::IndexType OutputIndexType;
00073 typedef typename TOutputImage::RegionType OutputImageRegionType;
00074
00076 typedef std::vector<InputPixelType> ThresholdVectorType;
00077
00079 itkStaticConstMacro(InputImageDimension, unsigned int,
00080 TInputImage::ImageDimension ) ;
00081 itkStaticConstMacro(OutputImageDimension, unsigned int,
00082 TOutputImage::ImageDimension ) ;
00083
00085 itkSetClampMacro( NumberOfHistogramBins, unsigned long, 1, NumericTraits<unsigned long>::max() );
00086 itkGetConstMacro( NumberOfHistogramBins, unsigned long );
00087
00089 itkSetClampMacro(NumberOfThresholds, unsigned long, 1, NumericTraits<unsigned long>::max() );
00090 itkGetConstMacro(NumberOfThresholds,unsigned long);
00091
00093 itkSetClampMacro(LabelOffset,OutputPixelType, NumericTraits<OutputPixelType>::Zero,NumericTraits<OutputPixelType>::max() );
00094 itkGetConstMacro(LabelOffset,OutputPixelType);
00095
00097 const ThresholdVectorType & GetThresholds() const
00098 {
00099 return m_Thresholds;
00100 }
00101
00102
00103 protected:
00104 OtsuMultipleThresholdsImageFilter();
00105 ~OtsuMultipleThresholdsImageFilter(){};
00106 void PrintSelf(std::ostream& os, Indent indent) const;
00107
00108 void GenerateInputRequestedRegion();
00109 void GenerateData ();
00110
00111 private:
00112 OtsuMultipleThresholdsImageFilter(const Self&);
00113 void operator=(const Self&);
00114
00115 unsigned long m_NumberOfHistogramBins;
00116 unsigned long m_NumberOfThresholds;
00117 OutputPixelType m_LabelOffset;
00118 ThresholdVectorType m_Thresholds;
00119
00120
00121 } ;
00122
00123 }
00124
00125 #ifndef ITK_MANUAL_INSTANTIATION
00126 #include "itkOtsuMultipleThresholdsImageFilter.txx"
00127 #endif
00128
00129 #endif