00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkOtsuThresholdImageFilter_h
00018 #define __itkOtsuThresholdImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkFixedArray.h"
00022
00023 namespace itk {
00024
00041 template<class TInputImage, class TOutputImage>
00042 class ITK_EXPORT OtsuThresholdImageFilter :
00043 public ImageToImageFilter<TInputImage, TOutputImage>
00044 {
00045 public:
00047 typedef OtsuThresholdImageFilter Self;
00048 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00051
00053 itkNewMacro(Self);
00054
00056 itkTypeMacro(OtsuThresholdImageFilter, ImageToImageFilter);
00057
00059 typedef typename TInputImage::PixelType InputPixelType;
00060 typedef typename TOutputImage::PixelType OutputPixelType;
00061
00063 typedef typename TInputImage::Pointer InputImagePointer;
00064 typedef typename TOutputImage::Pointer OutputImagePointer;
00065
00066 typedef typename TInputImage::SizeType InputSizeType;
00067 typedef typename TInputImage::IndexType InputIndexType;
00068 typedef typename TInputImage::RegionType InputImageRegionType;
00069 typedef typename TOutputImage::SizeType OutputSizeType;
00070 typedef typename TOutputImage::IndexType OutputIndexType;
00071 typedef typename TOutputImage::RegionType OutputImageRegionType;
00072
00073
00075 itkStaticConstMacro(InputImageDimension, unsigned int,
00076 TInputImage::ImageDimension ) ;
00077 itkStaticConstMacro(OutputImageDimension, unsigned int,
00078 TOutputImage::ImageDimension ) ;
00079
00082 itkSetMacro(OutsideValue,OutputPixelType);
00083
00085 itkGetMacro(OutsideValue,OutputPixelType);
00086
00089 itkSetMacro(InsideValue,OutputPixelType);
00090
00092 itkGetMacro(InsideValue,OutputPixelType);
00093
00095 itkSetClampMacro( NumberOfHistogramBins, unsigned long, 1,
00096 NumericTraits<unsigned long>::max() );
00097 itkGetMacro( NumberOfHistogramBins, unsigned long );
00098
00100 itkGetMacro(Threshold,InputPixelType);
00101
00102
00103 protected:
00104 OtsuThresholdImageFilter();
00105 ~OtsuThresholdImageFilter(){};
00106 void PrintSelf(std::ostream& os, Indent indent) const;
00107
00108 void GenerateInputRequestedRegion();
00109 void GenerateData ();
00110
00111 private:
00112 OtsuThresholdImageFilter(const Self&);
00113 void operator=(const Self&);
00114
00115 InputPixelType m_Threshold;
00116 OutputPixelType m_InsideValue;
00117 OutputPixelType m_OutsideValue;
00118 unsigned long m_NumberOfHistogramBins;
00119
00120 } ;
00121
00122 }
00123
00124 #ifndef ITK_MANUAL_INSTANTIATION
00125 #include "itkOtsuThresholdImageFilter.txx"
00126 #endif
00127
00128 #endif