For a detailed description of the methods, please see:
Landini G, Randell DA, Fouad S, Galton A. Automatic thresholding from the gradients of region boundaries. Journal of Microscopy, 2016. (PDF)
We would be grateful if you cite the paper in any publications where you use these methods (and let us know it).
The procedures implemented are based on a reinterpretation of the strategy observed in human operators when adjusting thresholds manually and interactively by means of 'slider' controls.
Users most often find the "right" threshold value by repeatedly over- and under-thresholding the image until the thresholded phase more or less coincides with the sought objects in the image. See, for example, Russ and Russ . The advantage of the computerised versions presented here is that the methods do not suffer from the uncertainty of "when to stop adjusting" the threshold.
Two different methods were implemented. The first one is a simple global thresholding procedure suitable for single or multiple global thresholds (i.e. one value for the whole image).
The procedure consists of searching the greyscale space for a threshold value that generates a phase whose boundary coincides with the largest gradients in the original image.
The plugin is called Threshold_Global_Gradient and it has the option of using two possible measures of the phase gradient (the mean and the total gradient).
The second method is a more interesting and complex variation of the same principle, but operates on the discrete connected components of the thresholded phase (i.e. candidate binary regions that might
represent the intended object in the image) independently, therefore becoming an adaptive local thresholding procedure which operates on regions, rather than
on pixels of local image subsets as is the case in the vast majority of local thresholding methods in the literature.
The procedure involves first a threshold decomposition step (where regions are extracted at all possible threshold ranges (e.g. from 0..n for dark objects). The boundaries of the binary regions thus generated are used to query the value of the average gradient at those positions in the original image. Then, the binary boundaries are labelled with that value and the ensemble of all boundaries is projected, retaining the maximum values (a maxima Z projection). The boundaries representing the highest gradients are then extracted by means of the regional maxima of the projection.
Furthermore, when combining filtering of the candidate regions based on morphological descriptors such as circularity and region size, the approach allows an efficient and clean extraction of the regions which exhibit the highest gradients.
Note that this is a computationally intensive procedure, so it is relatively slower than most other thresholding methods that process, for example, one dimensional histograms.
The regional threshold plugin is called Threshold_Regional_Gradient.
Further details of the algorithms, performance and examples are included in our paper accessible through Open Access. The java code is included in the Morphology collection. Please note that the plugins described here use additional classes also residing in the Morphology collection, so those need to be installed, too.
After restarting ImageJ, there should be a Morphology category under the Plugins menu entry. There you should be able to see entries for Threshold_Global_Gradient and Threshold_Regional_Gradient.
The plugins expect an 8-bit greyscale image.
Note that the Threshold_Regional_Gradient is 'hard-wired' to detect dark objects (low greyscale values) on a bright background (high greyscale values).
If you are intending to detect bright objects on a dark background, please invert the image before processing it. Please also be careful if the image is using an "inverted LUT".
Left: original image blurred with a Gaussian filter of radius 1. Right: the result of the regional thresholding (using the default plugin values).