ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkOtsuMultipleThresholdsCalculator.h>
Computes Otsu's multiple thresholds for a histogram.
You plug in the target histogram using SetInputHistogram method and specify the number of thresholds you want to be computed. Then call the Compute() method to run the algorithm.
The thresholds are computed so that the between-class variance is maximized.
This calculator also includes an option to use the valley emphasis algorithm from H.F. Ng, "Automatic thresholding for defect detection", Pattern Recognition Letters, (27): 1644-1649, 2006. The valley emphasis algorithm is particularly effective when the object to be thresholded is small. See the following tests for examples: itkOtsuMultipleThresholdsImageFilterTest3 and itkOtsuMultipleThresholdsImageFilterTest4 To use this algorithm, simple call the setter: SetValleyEmphasis(true) It is turned off by default.
Definition at line 49 of file itkOtsuMultipleThresholdsCalculator.h.
Public Member Functions | |
void | Compute () override |
const OutputType & | GetOutput () |
virtual void | SetNumberOfThresholds (SizeValueType _arg) |
virtual SizeValueType | GetNumberOfThresholds () const |
virtual void | SetValleyEmphasis (bool _arg) |
virtual const bool & | GetValleyEmphasis () const |
virtual void | ValleyEmphasisOn () |
virtual void | ValleyEmphasisOff () |
virtual void | SetReturnBinMidpoint (bool _arg) |
virtual const bool & | GetReturnBinMidpoint () const |
virtual void | ReturnBinMidpointOn () |
virtual void | ReturnBinMidpointOff () |
Public Member Functions inherited from itk::HistogramAlgorithmBase< TInputHistogram > | |
const TInputHistogram * | GetInputHistogram () const |
void | SetInputHistogram (const TInputHistogram *histogram) |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *) |
unsigned long | AddObserver (const EventObject &event, Command *) const |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexceptoverride |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
itkCloneMacro (Self) | |
void | Print (std::ostream &os, Indent indent=0) const |
Protected Member Functions | |
bool | IncrementThresholds (InstanceIdentifierVectorType &thresholdIds, MeanType totalMean, MeanVectorType &classMean, FrequencyVectorType &classFrequency) |
OtsuMultipleThresholdsCalculator () | |
void | PrintSelf (std::ostream &os, Indent indent) const override |
~OtsuMultipleThresholdsCalculator () override=default | |
Protected Member Functions inherited from itk::HistogramAlgorithmBase< TInputHistogram > | |
HistogramAlgorithmBase () | |
~HistogramAlgorithmBase () override=default | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | SetTimeStamp (const TimeStamp &time) |
~Object () override | |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Private Attributes | |
SizeValueType | m_NumberOfThresholds { 1 } |
OutputType | m_Output |
bool | m_ReturnBinMidpoint { false } |
bool | m_ValleyEmphasis { false } |
virtual const char * | GetNameOfClass () const |
virtual ::itk::LightObject::Pointer | CreateAnother () const |
static Pointer | New () |
Additional Inherited Members | |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount |
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::ConstPointer = SmartPointer< const Self > |
Definition at line 57 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::FrequencyType = typename TInputHistogram::AbsoluteFrequencyType |
Definition at line 60 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::FrequencyVectorType = std::vector< FrequencyType > |
Definition at line 67 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::InstanceIdentifierType = typename TInputHistogram::InstanceIdentifier |
Definition at line 70 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::InstanceIdentifierVectorType = std::vector< InstanceIdentifierType > |
Definition at line 71 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::MeanType = typename NumericTraits< MeasurementType >::RealType |
Definition at line 62 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::MeanVectorType = std::vector< MeanType > |
Definition at line 66 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::MeasurementType = typename TInputHistogram::MeasurementType |
Definition at line 59 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::OutputType = std::vector< MeasurementType > |
Typedef for the thresholds output
Definition at line 79 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::Pointer = SmartPointer< Self > |
Definition at line 56 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::Self = OtsuMultipleThresholdsCalculator |
Standard class type aliases.
Definition at line 54 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::Superclass = HistogramAlgorithmBase< TInputHistogram > |
Definition at line 55 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::VarianceType = typename NumericTraits< MeasurementType >::RealType |
Definition at line 63 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::WeightType = typename NumericTraits< MeasurementType >::RealType |
Definition at line 64 of file itkOtsuMultipleThresholdsCalculator.h.
using itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::WeightVectorType = std::vector< WeightType > |
Definition at line 68 of file itkOtsuMultipleThresholdsCalculator.h.
|
protected |
|
overrideprotecteddefault |
|
overridevirtual |
Calculates Otsu's thresholds and saves them.
Implements itk::HistogramAlgorithmBase< TInputHistogram >.
|
virtual |
Standard Macros
Reimplemented from itk::Object.
|
virtual |
Standard Macros
Reimplemented from itk::HistogramAlgorithmBase< TInputHistogram >.
|
virtual |
Set/Get the number of thresholds.
const OutputType& itk::OtsuMultipleThresholdsCalculator< TInputHistogram >::GetOutput | ( | ) |
Returns the thresholds vector
|
virtual |
Should the threshold value be mid-point of the bin or the maximum? Default is to return bin maximum.
|
virtual |
Set/Get the use of valley emphasis. Default is false.
|
protected |
Increment the thresholds of one position along the histogram.
|
static |
Standard Macros
Referenced by itk::OtsuThresholdCalculator< THistogram, TOutput >::OtsuThresholdCalculator().
|
overrideprotectedvirtual |
Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from itk::HistogramAlgorithmBase< TInputHistogram >.
|
virtual |
Should the threshold value be mid-point of the bin or the maximum? Default is to return bin maximum.
|
virtual |
Should the threshold value be mid-point of the bin or the maximum? Default is to return bin maximum.
|
virtual |
Set/Get the number of thresholds.
|
virtual |
Should the threshold value be mid-point of the bin or the maximum? Default is to return bin maximum.
|
virtual |
Set/Get the use of valley emphasis. Default is false.
|
virtual |
Set/Get the use of valley emphasis. Default is false.
|
virtual |
Set/Get the use of valley emphasis. Default is false.
|
private |
Definition at line 119 of file itkOtsuMultipleThresholdsCalculator.h.
|
private |
Definition at line 120 of file itkOtsuMultipleThresholdsCalculator.h.
|
private |
Definition at line 125 of file itkOtsuMultipleThresholdsCalculator.h.
|
private |
Definition at line 121 of file itkOtsuMultipleThresholdsCalculator.h.