00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkOtsuThresholdImageCalculator_h
00018 #define __itkOtsuThresholdImageCalculator_h
00019
00020 #include "itkObject.h"
00021 #include "itkObjectFactory.h"
00022 #include "itkNumericTraits.h"
00023
00024 namespace itk
00025 {
00026
00042 template <class TInputImage>
00043 class ITK_EXPORT OtsuThresholdImageCalculator : public Object
00044 {
00045 public:
00047 typedef OtsuThresholdImageCalculator Self;
00048 typedef Object Superclass;
00049 typedef SmartPointer<Self> Pointer;
00050 typedef SmartPointer<const Self> ConstPointer;
00051
00053 itkNewMacro(Self);
00054
00056 itkTypeMacro(OtsuThresholdImageCalculator, Object);
00057
00059 typedef TInputImage ImageType;
00060
00062 typedef typename TInputImage::Pointer ImagePointer;
00063
00065 typedef typename TInputImage::ConstPointer ImageConstPointer;
00066
00068 typedef typename TInputImage::PixelType PixelType;
00069
00071 itkSetConstObjectMacro(Image,ImageType);
00072
00074 void Compute(void);
00075
00077 itkGetMacro(Threshold,PixelType);
00078
00080 itkSetClampMacro( NumberOfHistogramBins, unsigned long, 1,
00081 NumericTraits<unsigned long>::max() );
00082 itkGetMacro( NumberOfHistogramBins, unsigned long );
00083
00084 protected:
00085 OtsuThresholdImageCalculator();
00086 virtual ~OtsuThresholdImageCalculator() {};
00087 void PrintSelf(std::ostream& os, Indent indent) const;
00088
00089 private:
00090 OtsuThresholdImageCalculator(const Self&);
00091 void operator=(const Self&);
00092
00093 PixelType m_Threshold;
00094 unsigned long m_NumberOfHistogramBins;
00095 ImageConstPointer m_Image;
00096
00097 };
00098
00099 }
00100
00101
00102 #ifndef ITK_MANUAL_INSTANTIATION
00103 #include "itkOtsuThresholdImageCalculator.txx"
00104 #endif
00105
00106 #endif