Class OtsuMultipleThresholdsImageFilter

java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.OtsuMultipleThresholdsImageFilter

public class OtsuMultipleThresholdsImageFilter extends ImageFilter
Threshold an image using multiple Otsu Thresholds. This filter creates a labeled image that separates the input image into various classes. The filter computes the thresholds using the OtsuMultipleThresholdsCalculator and applies those thresholds to the input image using the ThresholdLabelerImageFilter . The NumberOfHistogramBins and NumberOfThresholds can be set for the Calculator. The LabelOffset can be set for the ThresholdLabelerImageFilter . This filter 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. See: ScalarImageToHistogramGenerator OtsuMultipleThresholdsCalculator ThresholdLabelerImageFilter itk::simple::OtsuMultipleThresholds for the procedural interface itk::OtsuMultipleThresholdsImageFilter for the Doxygen on the original ITK class. C++ includes: sitkOtsuMultipleThresholdsImageFilter.h
  • Constructor Details

    • OtsuMultipleThresholdsImageFilter

      protected OtsuMultipleThresholdsImageFilter(long cPtr, boolean cMemoryOwn)
    • OtsuMultipleThresholdsImageFilter

      public OtsuMultipleThresholdsImageFilter()
      itk::simple::OtsuMultipleThresholdsImageFilter::OtsuMultipleThresholdsImageFilter() Default Constructor that takes no arguments and initializes default parameters
  • Method Details

    • getCPtr

      protected static long getCPtr(OtsuMultipleThresholdsImageFilter obj)
    • swigRelease

      protected static long swigRelease(OtsuMultipleThresholdsImageFilter obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class ImageFilter
    • delete

      public void delete()
      virtual itk::simple::OtsuMultipleThresholdsImageFilter::~OtsuMultipleThresholdsImageFilter() Destructor
      Overrides:
      delete in class ImageFilter
    • setNumberOfThresholds

      public void setNumberOfThresholds(short NumberOfThresholds)
      Self& itk::simple::OtsuMultipleThresholdsImageFilter::SetNumberOfThresholds(uint8_t NumberOfThresholds) Set/Get the number of thresholds. Default is 1.
    • getNumberOfThresholds

      public short getNumberOfThresholds()
      uint8_t itk::simple::OtsuMultipleThresholdsImageFilter::GetNumberOfThresholds() const Set/Get the number of thresholds. Default is 1.
    • setLabelOffset

      public void setLabelOffset(short LabelOffset)
      Self& itk::simple::OtsuMultipleThresholdsImageFilter::SetLabelOffset(uint8_t LabelOffset) Set/Get the offset which labels have to start from. Default is 0.
    • getLabelOffset

      public short getLabelOffset()
      uint8_t itk::simple::OtsuMultipleThresholdsImageFilter::GetLabelOffset() const Set/Get the offset which labels have to start from. Default is 0.
    • setNumberOfHistogramBins

      public void setNumberOfHistogramBins(long NumberOfHistogramBins)
      Self& itk::simple::OtsuMultipleThresholdsImageFilter::SetNumberOfHistogramBins(uint32_t NumberOfHistogramBins) Set/Get the number of histogram bins. Default is 128.
    • getNumberOfHistogramBins

      public long getNumberOfHistogramBins()
      uint32_t itk::simple::OtsuMultipleThresholdsImageFilter::GetNumberOfHistogramBins() const Set/Get the number of histogram bins. Default is 128.
    • setValleyEmphasis

      public void setValleyEmphasis(boolean ValleyEmphasis)
      Self& itk::simple::OtsuMultipleThresholdsImageFilter::SetValleyEmphasis(bool ValleyEmphasis) Set/Get the use of valley emphasis. Default is false.
    • valleyEmphasisOn

      public void valleyEmphasisOn()
      Self& itk::simple::OtsuMultipleThresholdsImageFilter::ValleyEmphasisOn() Set the value of ValleyEmphasis to true or false respectfully.
    • valleyEmphasisOff

      public void valleyEmphasisOff()
      Self& itk::simple::OtsuMultipleThresholdsImageFilter::ValleyEmphasisOff()
    • getValleyEmphasis

      public boolean getValleyEmphasis()
      bool itk::simple::OtsuMultipleThresholdsImageFilter::GetValleyEmphasis() const Set/Get the use of valley emphasis. Default is false.
    • setReturnBinMidpoint

      public void setReturnBinMidpoint(boolean ReturnBinMidpoint)
      Self& itk::simple::OtsuMultipleThresholdsImageFilter::SetReturnBinMidpoint(bool ReturnBinMidpoint) Should the threshold value be mid-point of the bin or the maximum? Default is to return bin maximum.
    • returnBinMidpointOn

      public void returnBinMidpointOn()
      Self& itk::simple::OtsuMultipleThresholdsImageFilter::ReturnBinMidpointOn() Set the value of ReturnBinMidpoint to true or false respectfully.
    • returnBinMidpointOff

      public void returnBinMidpointOff()
      Self& itk::simple::OtsuMultipleThresholdsImageFilter::ReturnBinMidpointOff()
    • getReturnBinMidpoint

      public boolean getReturnBinMidpoint()
      bool itk::simple::OtsuMultipleThresholdsImageFilter::GetReturnBinMidpoint() const Should the threshold value be mid-point of the bin or the maximum? Default is to return bin maximum.
    • getThresholds

      public VectorDouble getThresholds()
      std::vector<double> itk::simple::OtsuMultipleThresholdsImageFilter::GetThresholds() const Get the computed threshold. This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution.
    • getName

      public String getName()
      std::string itk::simple::OtsuMultipleThresholdsImageFilter::GetName() const Name of this class
      Overrides:
      getName in class ProcessObject
    • toString

      public String toString()
      std::string itk::simple::OtsuMultipleThresholdsImageFilter::ToString() const Print ourselves out
      Overrides:
      toString in class ProcessObject
    • execute

      public Image execute(Image image1)
      Image itk::simple::OtsuMultipleThresholdsImageFilter::Execute(const Image &image1) Execute the filter on the input image