public class Thresholder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
Messenger |
messenger
The object used for message displaying.
|
Progressor |
progressor
The object used for progress displaying.
|
Constructor and Description |
---|
Thresholder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
hard(Image image,
double threshold)
Applies hard thresholding to an image.
|
void |
hysteresis(Image image,
double low,
double high)
Applies hysteresis thresholding to an image.
|
void |
hysteresisLowConnectivity(Image image,
double low,
double high) |
public final Messenger messenger
public final Progressor progressor
public void hard(Image image, double threshold)
image
- the input image to be thresholded. The image is overwritten with the thresholding results.threshold
- the threshold value. Elements with a value larger than or equal to threshold
are set to 255
, and elements with a value less than threshold
are set to 0
.java.lang.NullPointerException
- if image
is null
.public void hysteresis(Image image, double low, double high)
image
- the input image to be thresholded. The image is overwritten with the thresholding results.low
- high
- the lower and higher threshold values that define the hysteresis. Elements with a value larger than or equal to high
are set to 255
,
elements with a value less than low
are set to 0
, and elements with a value larger than or equal to the low
are set to 255
only if they are connected to elements with a value larger than or equal to high
through elements all with a value larger than or equal to low
.
If the size of the image in the z-dimension equals 1
, this method uses 8-connectivity in x-y space, otherwise it uses 26-connectivity in x-y-z space.
The algorithm is applied to every x-y(-z) subimage in a 5D image.java.lang.NullPointerException
- if image
image is null
.public void hysteresisLowConnectivity(Image image, double low, double high)