Threshold image

Binarise an image in the workspace such that the output only has pixel values of 0 and 255.

Description

Binarise an image in the workspace such that the output only has pixel values of 0 and 255. Uses the built-in ImageJ global and 2D local auto-thresholding algorithms.

Note: Currently only works on 8-bit images. Images with other bit depths will be automatically converted to 8-bit based on the "Fill target range (normalise)" scaling method from the "Image type converter" module.

Parameters

Parameter Description
Input image Image to apply threshold to.
Apply to input image Select if the threshold should be applied directly to the input image, or if it should be applied to a duplicate, then stored as a different image in the workspace.
Output image Name of the output image created during the thresholding process. This image will be added to the workspace.
Threshold type Class of threshold to be applied.

- "Global" (default) will apply a constant, automatically-determined threshold value to all pixels in the image. This is best when the image is uniformly illuminated.

- " Local" will apply a variable threshold to each pixel in the image based on the local intensity around that pixel. This is best when one region of the image is brighter than another, for example, due to heterogeneous illumination. The size of the local region is determined by the user.

- " Manual" will apply a fixed threshold value to all pixels in the image.
Global threshold algorithm Global thresholding algorithm to use.
Local threshold algorithm Local thresholding algorithm to use.
Threshold multiplier Prior to application of automatically-calculated thresholds the threshold value is multiplied by this value. This allows the threshold to be systematically increased or decreased. For example, a "Threshold multiplier" of 0.9 applied to an automatically-calculated threshold of 200 will see the image thresholded at the level 180.
Use lower threshold limit Limit the lowest threshold that can be applied to the image. This is used to prevent unintentional segmentation of an image containing only background (i.e. no features present).
Lower threshold limit Lowest absolute threshold value that can be applied.
Local radius Radius of region to be used when calculating local intensity thresholds. Units controlled by "Spatial units mode" control.
Spatial units mode Controls whether spatial values are assumed to be specified in calibrated units (as defined by the "Input control" parameter "Spatial unit") or pixel units.
Threshold value Absolute manual threshold value that will be applied to all pixels.
Use full Z-range ("Global Z") When performing 3D local thresholding, this takes all z-values at a location into account. If disabled, pixels will be sampled in z according to the "Local radius" setting.
Black objects/white background Controls the logic of the output image in terms of what is considered foreground and background.