00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkOtsuThresholdImageCalculator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/09/20 22:51:23 $ 00007 Version: $Revision: 1.3 $ 00008 00009 Copyright (c) 2002 Insight Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 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&); //purposely not implemented 00091 void operator=(const Self&); //purposely not implemented 00092 00093 PixelType m_Threshold; 00094 unsigned long m_NumberOfHistogramBins; 00095 ImageConstPointer m_Image; 00096 00097 }; 00098 00099 } // end namespace itk 00100 00101 00102 #ifndef ITK_MANUAL_INSTANTIATION 00103 #include "itkOtsuThresholdImageCalculator.txx" 00104 #endif 00105 00106 #endif