Package org.itk.simple
Class OtsuThresholdImageFilter
java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.OtsuThresholdImageFilter
Threshold an image using the Otsu Threshold.
This filter creates a binary thresholded image that separates an image
into foreground and background components. The filter computes the
threshold using the OtsuThresholdCalculator and applies that threshold to the input image using the BinaryThresholdImageFilter .
Richard Beare
Gaetan Lehmann. Biologie du Developpement et de la Reproduction, INRA
de Jouy-en-Josas, France.
This implementation was taken from the Insight Journal paper: https://www.insight-journal.org/browse/publication/811
See:
HistogramThresholdImageFilter
itk::simple::OtsuThreshold for the procedural interface
itk::OtsuThresholdImageFilter for the Doxygen on the original ITK class.
C++ includes: sitkOtsuThresholdImageFilter.h
-
Field Summary
Fields inherited from class org.itk.simple.ProcessObject
swigCMemOwn
-
Constructor Summary
ConstructorsModifierConstructorDescriptionitk::simple::OtsuThresholdImageFilter::OtsuThresholdImageFilter() Default Constructor that takes no arguments and initializes default parametersprotected
OtsuThresholdImageFilter
(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
virtual itk::simple::OtsuThresholdImageFilter::~OtsuThresholdImageFilter() DestructorImage itk::simple::OtsuThresholdImageFilter::Execute(const Image &image, const Image &maskImage) Execute the filter on the input imageImage itk::simple::OtsuThresholdImageFilter::Execute(const Image &image, const Image &maskImage) Execute the filter on the input imageprotected void
finalize()
protected static long
short
uint8_t itk::simple::OtsuThresholdImageFilter::GetInsideValue() const Get the "inside" pixel value.boolean
bool itk::simple::OtsuThresholdImageFilter::GetMaskOutput() constshort
uint8_t itk::simple::OtsuThresholdImageFilter::GetMaskValue() constgetName()
std::string itk::simple::OtsuThresholdImageFilter::GetName() const Name of this classlong
uint32_t itk::simple::OtsuThresholdImageFilter::GetNumberOfHistogramBins() constshort
uint8_t itk::simple::OtsuThresholdImageFilter::GetOutsideValue() const Get the "outside" pixel value.boolean
bool itk::simple::OtsuThresholdImageFilter::GetReturnBinMidpoint() const Should the threshold value be mid-point of the bin or the maximum? Default is to return bin maximum.double
double itk::simple::OtsuThresholdImageFilter::GetThreshold() const Get the computed threshold.void
Self& itk::simple::OtsuThresholdImageFilter::MaskOutputOff()void
Self& itk::simple::OtsuThresholdImageFilter::MaskOutputOn() Set the value of MaskOutput to true or false respectfully.void
Self& itk::simple::OtsuThresholdImageFilter::ReturnBinMidpointOff()void
Self& itk::simple::OtsuThresholdImageFilter::ReturnBinMidpointOn() Set the value of ReturnBinMidpoint to true or false respectfully.void
setInsideValue
(short InsideValue) Self& itk::simple::OtsuThresholdImageFilter::SetInsideValue(uint8_t InsideValue) Set the "inside" pixel value.void
setMaskOutput
(boolean MaskOutput) Self& itk::simple::OtsuThresholdImageFilter::SetMaskOutput(bool MaskOutput) Do you want the output to be masked by the mask used in histogram construction.void
setMaskValue
(short MaskValue) Self& itk::simple::OtsuThresholdImageFilter::SetMaskValue(uint8_t MaskValue) The value in the mask image, if used, indicating voxels that should be included.void
setNumberOfHistogramBins
(long NumberOfHistogramBins) Self& itk::simple::OtsuThresholdImageFilter::SetNumberOfHistogramBins(uint32_t NumberOfHistogramBins) Set/Get the number of histogram bins.void
setOutsideValue
(short OutsideValue) Self& itk::simple::OtsuThresholdImageFilter::SetOutsideValue(uint8_t OutsideValue) Set the "outside" pixel value.void
setReturnBinMidpoint
(boolean ReturnBinMidpoint) Self& itk::simple::OtsuThresholdImageFilter::SetReturnBinMidpoint(bool ReturnBinMidpoint) Should the threshold value be mid-point of the bin or the maximum? Default is to return bin maximum.protected static long
toString()
std::string itk::simple::OtsuThresholdImageFilter::ToString() const Print ourselves outMethods inherited from class org.itk.simple.ImageFilter
getCPtr, swigRelease
Methods inherited from class org.itk.simple.ProcessObject
abort, addCommand, debugOff, debugOn, getCPtr, getDebug, getGlobalDefaultCoordinateTolerance, getGlobalDefaultDebug, getGlobalDefaultDirectionTolerance, getGlobalDefaultNumberOfThreads, getGlobalDefaultThreader, getGlobalWarningDisplay, getNumberOfThreads, getNumberOfWorkUnits, getProgress, globalDefaultDebugOff, globalDefaultDebugOn, globalWarningDisplayOff, globalWarningDisplayOn, hasCommand, removeAllCommands, setDebug, setGlobalDefaultCoordinateTolerance, setGlobalDefaultDebug, setGlobalDefaultDirectionTolerance, setGlobalDefaultNumberOfThreads, setGlobalDefaultThreader, setGlobalWarningDisplay, setNumberOfThreads, setNumberOfWorkUnits, swigRelease
-
Constructor Details
-
OtsuThresholdImageFilter
protected OtsuThresholdImageFilter(long cPtr, boolean cMemoryOwn) -
OtsuThresholdImageFilter
public OtsuThresholdImageFilter()itk::simple::OtsuThresholdImageFilter::OtsuThresholdImageFilter() Default Constructor that takes no arguments and initializes default parameters
-
-
Method Details
-
getCPtr
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classImageFilter
-
delete
public void delete()virtual itk::simple::OtsuThresholdImageFilter::~OtsuThresholdImageFilter() Destructor- Overrides:
delete
in classImageFilter
-
setInsideValue
public void setInsideValue(short InsideValue) Self& itk::simple::OtsuThresholdImageFilter::SetInsideValue(uint8_t InsideValue) Set the "inside" pixel value. The default value NumericTraits<OutputPixelType>::max() -
getInsideValue
public short getInsideValue()uint8_t itk::simple::OtsuThresholdImageFilter::GetInsideValue() const Get the "inside" pixel value. -
setOutsideValue
public void setOutsideValue(short OutsideValue) Self& itk::simple::OtsuThresholdImageFilter::SetOutsideValue(uint8_t OutsideValue) Set the "outside" pixel value. The default value NumericTraits<OutputPixelType>::Zero. -
getOutsideValue
public short getOutsideValue()uint8_t itk::simple::OtsuThresholdImageFilter::GetOutsideValue() const Get the "outside" pixel value. -
setNumberOfHistogramBins
public void setNumberOfHistogramBins(long NumberOfHistogramBins) Self& itk::simple::OtsuThresholdImageFilter::SetNumberOfHistogramBins(uint32_t NumberOfHistogramBins) Set/Get the number of histogram bins. Defaults is 128. -
getNumberOfHistogramBins
public long getNumberOfHistogramBins()uint32_t itk::simple::OtsuThresholdImageFilter::GetNumberOfHistogramBins() const -
setMaskOutput
public void setMaskOutput(boolean MaskOutput) Self& itk::simple::OtsuThresholdImageFilter::SetMaskOutput(bool MaskOutput) Do you want the output to be masked by the mask used in histogram construction. Only relevant if masking is in use. -
maskOutputOn
public void maskOutputOn()Self& itk::simple::OtsuThresholdImageFilter::MaskOutputOn() Set the value of MaskOutput to true or false respectfully. -
maskOutputOff
public void maskOutputOff()Self& itk::simple::OtsuThresholdImageFilter::MaskOutputOff() -
getMaskOutput
public boolean getMaskOutput()bool itk::simple::OtsuThresholdImageFilter::GetMaskOutput() const -
setMaskValue
public void setMaskValue(short MaskValue) Self& itk::simple::OtsuThresholdImageFilter::SetMaskValue(uint8_t MaskValue) The value in the mask image, if used, indicating voxels that should be included. Default is the max of pixel type, as in the MaskedImageToHistogramFilter -
getMaskValue
public short getMaskValue()uint8_t itk::simple::OtsuThresholdImageFilter::GetMaskValue() const -
setReturnBinMidpoint
public void setReturnBinMidpoint(boolean ReturnBinMidpoint) Self& itk::simple::OtsuThresholdImageFilter::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::OtsuThresholdImageFilter::ReturnBinMidpointOn() Set the value of ReturnBinMidpoint to true or false respectfully. -
returnBinMidpointOff
public void returnBinMidpointOff()Self& itk::simple::OtsuThresholdImageFilter::ReturnBinMidpointOff() -
getReturnBinMidpoint
public boolean getReturnBinMidpoint()bool itk::simple::OtsuThresholdImageFilter::GetReturnBinMidpoint() const Should the threshold value be mid-point of the bin or the maximum? Default is to return bin maximum. -
getThreshold
public double getThreshold()double itk::simple::OtsuThresholdImageFilter::GetThreshold() 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
std::string itk::simple::OtsuThresholdImageFilter::GetName() const Name of this class- Overrides:
getName
in classProcessObject
-
toString
std::string itk::simple::OtsuThresholdImageFilter::ToString() const Print ourselves out- Overrides:
toString
in classProcessObject
-
execute
Image itk::simple::OtsuThresholdImageFilter::Execute(const Image &image, const Image &maskImage) Execute the filter on the input image -
execute
Image itk::simple::OtsuThresholdImageFilter::Execute(const Image &image, const Image &maskImage) Execute the filter on the input image
-