Short Description

Extract image features based on one or more intensity thresholds, and output the result as a labeled image or as a region of interest.

Documentation

This plug-in extracts area in the image according to their pixel value, based on some user-defined (or automatically calculated) thresholds.

For the purpose of describing how the plug-in works, let’s assume we have a single channel 8-bit image (values ranging from 0 to 255). The description below still stands for multi-channel data (each channel will be processed separately) and non 8-bit data (there is no restriction on the data type).

The plug-in has two general working modes:

1. Manual mode (Method = “MANUAL”, this is the default mode when you start the plug-in)

In this mode, the “Manual Thresholds” field expects you to manually enter one (or more) threshold values (multiple values should be separated by spaces).

If you indicate only a single value (e.g. 155), the result will be a “traditional” binary image such that:

  • [image values between 0 and 155] => 0
  • [image values between 156 and 255] => 1

If you indicate 2 values (this is what the plug-in suggests at startup with “100.0 200.0”), the result will be a pseudo-binary (aka labeled) image such that:

  • [image values between 0 and 100] => 0
  • [image values between 101 and 200] => 1
  • [image values between 201 and 255] => 2

Using 2 thresholds can be useful when you have an image containing a dark background, and a combination of dim and bright structures that you wish to isolate separately.

You can of course indicate more than 2 values, and the result will follow the same pattern: you will obtain a pseudo-binary image with each label describing each range of intensity (“class” is the technical term for each intensity range, or area in the histogram).

2. Automated mode (Method = “KMeans”)

In this mode, you do *not* have to indicate the threshold values yourself. However, you have to indicate how many “classes” (i.e. areas in the histogram) you which to distinguish.

If you indicate “2” (the minimum possible value), you are basically telling the plug-in that your histogram has 2 distinct areas (aka classes), and that the plug-in should automatically calculate the (one) threshold value that best separates them (think of a histogram with two modes or peaks, the optimal threshold would be the midpoint between these 2 peaks). In comparison with the manual mode, it may calculate the same value of 155, but it could have given 157 if it believes this is statistically a better threshold based on the histogram.

If you indicate “3”, you are now asking the plug-in to distinguish 3 classes in the histogram. The plug-in will therefore calculate 2 threshold values (to separate the 3 classes). Again this is equivalent to giving (manually) 2 thresholds as in the example above.

The algorithm used in this mode to automatically calculate the final threshold value(s) is called “KMeans”, and basically will try to statistically optimise the position of the threshold(s) in the histogram such that the final classes are as dense as possible, and as well separated as possible, by maximising the variance between classes.

3. Output

By default, the plug-in will produce a binary (or pseudo-binary) image following the conventions defined above. This output is however not the most handy, as it does not give you any information on the extracted areas (size, number of objects, intensity statistics on the original image, etc.). A much more user-friendly way to manipulate the output is to convert this image into one or more Regions of Interest (ROI). There are two ways to produce regions of interests from thresholded data:

  • This plug-in itself has a field called “Output as” which lets you select between “Sequence” and “ROI” modes. While “Sequence” (the default mode) produces a binary or pseudo-binary image, “ROI” will convert each histogram class into a ROI that is added onto the original image (and accessible via Icy’s ROI panel), with a name that indicates the corresponding threshold value (this is useful to double-check the threshold values, especially when if they have been calculated automatically).
  • The “ROI” option will not distinguish multiple objects within a given class that might be spatially separated. If you wish to create a ROI for each object separately, then you should ask instead to produce a pseudo-binary image, and extract objects from that image using the Label Extractor plug-in.

Resources needing this

4 reviews on “Thresholder

  1. IcyLyd
    Really convenient. The exports in ROI and/or sequence are particularly usefull. I would love a graphical interface enabling the setting of the threshold limits over the histogram.
  2. M
    Excellent tool! Thank you very much! I'd love to see a progress bar showing the approximate percentage of task completion, instead of the one showing that the operation is ongoing.
  3. Anonymous
    Really nice tool! But it would be very helpful if the protocol version could be extended by the size filter for the output "Multiple ROI". Thank you very much! :)

Leave a Review

Leave a review
Cancel review
View full changelog
Close changelog

Changelog

  • Version 3.5.2.0 • Released on: 2021-06-23 18:00:00
    Download
    Description:

    - compatible with Icy Virtual Mode
    - fixed ROI T position which was set to 0 for single frame ROI

  • Version 3.5.0.0 • Released on: 2019-02-28 15:27:19
    Download
    Description:

    Minor change to ensure compatibility with future image cache

  • Version 3.4.3.0 • Released on: 2016-02-11 10:43:59
    Download
    Description:

    Simplified ROI export logic (fixing a few bugs on the way)

  • Version 3.4.2.0 • Released on: 2015-12-10 08:54:46
    Download
    Description:

    Fixed an issue with the KMeans calculation

  • Version 3.4.1.0 • Released on: 2015-10-08 21:11:41
    Download
    Description:

    Z & C return to -1 when unnecessary(was posing too many problems)

  • Version 3.4.0.0 • Released on: 2015-08-05 12:34:46
    Download
    Description:

    Added size filter on multiple ROI output

  • Version 3.3.0.0 • Released on: 2015-06-17 00:20:21
    Download
    Description:

    * Improved KMeans threshold calculation
    * Option to export multiple ROI (based on connected component extraction)

  • Version 3.2.5.0 • Released on: 2014-02-18 11:22:40
    Download
    Description:

    Removed time frame from the name of the constructed ROI

  • Version 3.2.4.0 • Released on: 2014-02-17 15:39:42
    Download
    Description:

    ROI now retain the channel on which they were obtained

  • Version 3.2.3.0 • Released on: 2014-01-29 18:45:30
    Download
    Description:

    Thresholded ROI now retain Z information (and 0 instead of -1 in 2D)

  • Version 3.2.2.0 • Released on: 2013-11-15 16:56:54
    Download
    Description:

    Fixed an issue when thresholding sequences with empty images

  • Version 3.2.1.1 • Released on: 2013-10-30 20:11:49
    Download
    Description:

    Updated to Icy 1.4.0.0

  • Version 3.2.1.0 • Released on: 2013-07-18 10:09:35
    Download
    Description:

    Fixed dependency issues with the "3D ROI Stacks" plugin

  • Version 3.2.0.0 • Released on: 2013-07-15 18:18:33
    Download
    Description:

    * Fixed bug with the "independent time frames" feature not calculating correct thresholds
    * New feature: set thresholds as percentiles instead of absolute values

  • Version 3.1.1.0 • Released on: 2013-07-03 10:08:41
    Download
    Description:

    Fixed issue in 3D ROI output

  • Version 3.1.0.0 • Released on: 2013-06-07 15:29:56
    Download
    Description:

    new: ROI output

  • Version 3.0.3.0 • Released on: 2012-12-21 15:06:42
    Download
    Description:

    Removed BlockInfo interface (deprecated as of Blocks 1.12)

  • Version 3.0.2.2 • Released on: 2012-11-08 18:37:08
    Download
    Description:

    KMeans class was missing from the jar file

  • Version 3.0.2.1 • Released on: 2012-10-24 15:59:59
    Download
    Description:

    Throw appropriate messages when receiving incorrect parameters.

  • Version 3.0.2.0 • Released on: 2012-07-10 11:31:01
    Download
    Description:

    * Provide default threshold values for new users
    * Adjust the output sequence name

  • Version 3.0.1.0 • Released on: 2012-06-24 23:25:47
    Download
    Description:

    Updated to Vars 1.2.0.0: uses native array types

  • Version 3.0.0.1 • Released on: 2012-06-21 17:56:16
    Download
    Description:

    Missing class file in jar file

  • Version 3.0.0.0 • Released on: 2012-06-21 13:58:41
    Download
    Description:

    Support for Blocks programming.
    Available blocks:
    - KMeans threshold computation
    - Core threshold block

  • Version 2.0.9.0 • Released on: 2012-03-23 14:08:49
    Download
    Description:

    throw exception if threshold array is null (becomes an error message at runtime in GUI mode)

  • Version 2.0.8.0 • Released on: 2012-03-08 11:50:04
    Download
    Description:

    Display an error message if no threshold value is given for the manual threshold case

  • Version 2.0.7.1 • Released on: 2012-02-20 13:04:50
    Download
    Description:

    Updated to EzPlug 1.6.4.1

  • Version 2.0.7.0 • Released on: 2012-02-07 15:25:52
    Download
    Description:

    minor fixes and updated to comply with EzPlug 1.6+

  • Version 2.0.6.0 • Released on: 2011-11-09 10:27:27
    Download
    Description:

    * new method to compute KMeans threshold from a given sequence frame
    * possibility to threshold each frame of a sequence independently

  • Version 2.0.5.0 • Released on: 2011-11-08 11:12:43
    Download
    Description:

    upgraded to icy.type.DataType (as of Icy 1.1.1.0)

  • Version 2.0.4.1 • Released on: 2011-07-13 17:37:05
    Download
    Description:

    updated build to ICY 1.0.6.0

  • Version 2.0.4.0 • Released on: 2011-06-20 15:36:57
    Download
    Description:

    bugfix: maximum channel value was not correctly set for color images

  • Version 2.0.3.0 • Released on: 2011-05-20 18:20:09
    Download
    Description:

    Fixed a bug in the thresholding algorithm causing "in-place" thresholding to fail in some cases

  • Version 2.0.2.0 • Released on: 2011-05-01 23:00:27
    Download
    Description:

    Fixed bug occurring on non in-place thresholding of multi-channel images

  • Version 2.0.1.0 • Released on: 2011-04-29 19:16:06
    Download
    Description:

    bug fix in the "in-place" algorithm

  • Version 2.0.0.0 • Released on: 2011-04-29 19:10:00
    Download
    Description:

    New implementation, faster, and handles all possible data types, with possibility to perform "in-place" threshold of the input.

  • Version 1.0.0.0 • Released on: 2011-04-29 08:22:58
    Download