StrataQuest Home › StrataQuest Glossary › Thresholding & Comparison
BOM Operation

Thresholding & Comparison

Twelve operations that test or cap each pixel

Definition
Two kinds of operation share this group. Compare tests every pixel against a condition, such as greater than 45, and writes 255 where it holds and 0 where it doesn't: a binary maskLoading.... Threshold applies a similar test but keeps the image, replacing only the pixels past the cutoff with a value you choose. OtsuLoading... picks the cutoff itself and returns a mask.
Detection - Total Area
Video · Primary
Detection - Automatic Background Threshold params
Video · Primary
Supporting
Dynamic range - 16bit to 8bit normalization
Video · Supporting
Detection - Nuclei Segmentation Classic
Video · Supporting
Measurements Mask - Cellular
Video · Supporting
Twelve operations, two outputs
Masks from Compare and Otsu, images from Threshold
Compare tests, Threshold rewrites
Both compare with values you set
Interval variants
Inside a band, or outside it
RGB versions
Compare (RGB) needs every channel to pass
Otsu computes the value
Automatic threshold from the intensity distribution

Picking the right engine

All twelve sit in the Basic Operations Module under Threshold and Compare. Pick by what you have and what you need back.

Your input and goalOperation
One grayscale imageLoading...; a mask of pixels above a valueCompare, with Compare Mode = Greater (or Greater or Equal)
One grayscale image; a mask of pixels below, or not equal to, a valueCompare, with Less, Less or equal, or Not equal
One grayscale image; a mask of pixels inside an intensity bandCompare - inside interval
One grayscale image; a mask of pixels outside a bandCompare - outside interval
One grayscale image, and you don't know the right valueOtsuLoading..., or Otsu (with range) when noise or shading spoils the two-peak shape; then look at the result
A color image; a mask where every channel passes its value or bandCompare (RGB), Compare - inside interval (RGB) or Compare - outside interval (RGB)
Keep the image, but replace values past a cutoff, such as flooring dim background or capping bright spotsThreshold or Threshold - LT, GT (RGB versions for color)
Two images; a mask where one is brighter than the otherNot in this group. Subtract images (Arithmetic) gives Image 2 minus Image 1, which Compare can then test against 0.

Compare starts at Threshold 0 with Compare Mode Less. On an ordinary 8-bit image, no pixel is less than 0, so the default mask comes out empty until you set both. Include interval limits (default No) switches the interval operations from strict to inclusive bounds.

These operations chain inside one Basic Operations Module, and each can use only the outputs of operations listed above it (see the StrataQuest workspaceLoading...). A mask from Compare is still one anonymous set of pixels; labelingLoading... turns it into separate objects. For one Otsu value computed from all fields of view, there is a separate engine, Otsu Threshold (global)Loading..., which can feed Total AreaLoading.... The NucleiLoading... engine's Automatic Background Threshold uses Otsu's method too.

Source: StrataQuest 8.1 Engines Reference, ch. 6 (pp. 18–19), ch. 6.1 (pp. 69–71), ch. 6.11 (pp. 310–348), ch. 26 (p. 450), ch. 33 (pp. 480–482); User Manual, Quick Actions (p. 154).

What a threshold value represents

A threshold is a single number standing in for a biological boundary, a categorical answer drawn from continuous data. The pixels just above it and just below it usually have similar intensities. The threshold is the line you draw across that continuum, so that the rest of the workflow has a decision to act on. Compare and Otsu make that decision; Threshold does not, because it only reshapes values for whatever comes next.

The decision has a sensitivity. If moving the cutoff from 100 to 95 changes the foreground area by 30%, the analysis is highly threshold-sensitive, so report the value or use an automatic methodLoading... that makes a reproducible choice. If the same move changes the area by 1%, the foreground is well separated and small variations won't matter.

The histogramLoading... tells you which regime you're in before you commit. Two clean peaks with a deep valley between them mean the cutoff can sit in the valley, and that is also the case Otsu's method handles well. The Engines Reference warns that when the objects cover only a small part of the image, the histogram stops being two-peaked and Otsu can pick a wrong value; one smooth distribution means the cutoff is an editorial line on a continuum, and the choice deserves an explanation. The same question arises one level up, where cutoffsLoading... in diagrams split cells rather than pixels.

Share This Term
Term Connections