StrataQuest Home › StrataQuest Glossary › Post Processing
BOM Group

Post Processing

Remove events by size, brightness or seed overlap

View
Definition
Detection finds events, and not all of them are wanted. The Post Processing group holds six operations that delete events from a coded imageLoading...: Remove labels (larger) and (smaller) by area in pixels, Remove labels (stronger) and (weaker) by mean intensity in a gray image, and Remove objects (with seeds) and (without seeds) by whether a seed image touches them.
Supporting
Detection - Automatic Background Threshold params
Video · Supporting
H&EDSPTCH
Video · Supporting
Size: area in pixels
One Area threshold (px), two directions
Brightness: mean intensity
Measured in a gray image you supply
Seeds: one shared pixel
Overlap with a second image is the test
Mask cleanup is elsewhere
Fill holes and area opening are Morphological

Operations Reference

OperationInputsDescription
Remove labels (larger)Image; Area threshold (px) (default 0)Deletes events with an area greater than the threshold.
Remove labels (smaller)Image; Area threshold (px) (default 0)Deletes events with an area less than the threshold.
Remove labels (stronger)Image 1 (coded); Image 2 (gray); Intensity threshold (default 0)Averages the Image 2 pixels under each event's body and deletes events whose mean intensity is greater than the threshold.
Remove labels (weaker)Image 1 (coded); Image 2 (gray); Intensity threshold (default 0)The same mean, deleting events whose mean intensity is less than the threshold.
Remove objects (with seeds)Image 1; Image 2 (seeds)Deletes the Image 1 objects that have a seed in Image 2. An Image 2 object is a seed if it intersects the Image 1 object by at least 1 pixel.
Remove objects (without seeds)Image 1; Image 2 (seeds)Deletes the Image 1 objects that have no seed in Image 2.

Each name says what goes, so read it as its opposite: Remove labels (smaller) keeps the larger events. In the reference's examples the four Remove labels operations return a coded image, and the two Remove objects operations are shown on 8-bit masks and return a mask. The surviving events keep their numbers. The Re-Label entry names Remove labels as a source of missing labels and recommends Re-Label (missing)Loading... afterward.

Hole filling and small-object removal on masks belong to the Morphological group: Fill holesLoading... (setting: Allow fill on border), Fill small holes and Remove small objects (from mask) (setting: Area threshold (px) for both).

Source: StrataQuest 8.1 Engines Reference, ch. 6.9 (pp. 284–303); ch. 6.8 (pp. 227–255); ch. 6.6 (pp. 195–198).

Simplified

The six Post Processing operations throw away detected objects: ones that are too big or too small, too bright or too dim, or that do or don't touch a second set of objects. Filling holes and removing specks from a mask happen earlier, in the Morphological group.

Image Processing Foundation

Cleanup comes at two levels, and it helps to keep them apart. Pixel-level cleanup changes a mask's shape with mathematical morphology. Object-level cleanup keeps or deletes whole objects, so every survivor stays exactly as detected. StrataQuest's Morphological group works at the first level, and the Post Processing group at the second.

Morphological shaping

In mathematical morphology generally, a small probe called a structuring elementLoading... determines what changes. Erosion keeps only the points where the probe fits inside the object, so the object shrinks. Dilation adds every point the probe covers as it slides along the object, so the object grows.

The reference gives a concrete case: a square of side 10 dilated by a disk of radius 2 becomes a square of side 14 with rounded corners, and eroded by the same disk it becomes a square of side 6. In StrataQuest, Erode, Dilate, Open and Close each take Kernel radius (px) and Kernel shape (default Disk).

A morphological openingLoading... (erode, then dilate) removes small objects and protrusions, and a closing (dilate, then erode) fills small holes and gaps, each with the same kernel. Both reshape every object they touch: an opening rounds the corners of the survivors too.

Distance Transforms & Watershed

Separating touching objects isn't a post-processing operation, but it sits close by in the pipeline. In image processing generally, a distance mapLoading... gives each foreground pixel its distance to the nearest background, and its peaks mark object centers. A watershedLoading... grows regions from those centers and draws a boundary wherever two meet. StrataQuest has its own distance map and watershed engines for this.

Connected Component Analysis

Object-level work needs objects first. Labeling gives each connected group of foreground pixels its own number, and StrataQuest's Label operation offers 4-connectivity (the default), which joins pixels that touch horizontally or vertically, or 8-connectivity, which adds diagonals. The choice determines whether two pixels touching at a corner are one object or two.

Once objects exist, filtering by area is the object-level counterpart of an opening. The reference calls Remove small objects (from mask) an area opening: it removes small objects, and unlike a morphological opening it leaves the shape of every survivor untouched. Remove labels (smaller) does the same job on a coded image.

Pipeline Ordering

The reference stresses that order matters inside the Basic Operations Module, because an operation can use only the outputs of operations above it. It recommends no fixed sequence. A sequence that follows from what each step does: clean the mask (fill, then remove specks), label it, delete unwanted events, then re-label. Filling before area removal keeps a nucleus with a dim center from being dropped as small.

Simplified

There are two ways to clean up a detection. You can reshape the mask pixel by pixel: erosion shrinks objects and dilation grows them, and combined they remove specks or fill gaps. Or you can keep or throw away whole objects by size or brightness, which leaves the survivors exactly as they were found. The Post Processing group does the second.

When to Use Which

Clean the mask first

Before labeling, work on the mask in the Morphological group. Use Fill holesLoading... when uneven staining leaves holes, and Fill small holes when only holes below an area should close. Use Remove small objects (from mask) to drop specks; the reference's example removes every object under 1000 pixels from a DAPI threshold mask. Use Open (erode, dilate) to remove small protrusions, accepting that it reshapes everything.

Then filter the events

After labeling, use the Post Processing group. Remove labels (smaller) and (larger) set a size window in pixels. Remove labels (weaker) and (stronger) set a brightness window, measured in whatever gray image you pass as Image 2, so you can judge DAPI-detected nuclei by a marker channel.

Remove objects (without seeds) keeps the objects a second detection confirms, and Remove objects (with seeds) keeps the ones it missed. The Removal operationsLoading... page shows how to pick among the six.

Layer-level alternatives

The layer's own Post-Processing section has two related engines: Remove objects v2, which keeps events whose chosen measurements fall within a range, and Remove objects touching border, which drops events that reach the sample or region-of-interest border. See Remove ObjectsLoading....

Processing Order

Fill, remove specks, label, delete unwanted events, re-label. Pipeline Ordering, above, gives the reasons.

Simplified

Work in order: fill holes and remove specks on the mask, label it to create the coded imageLoading..., then delete unwanted events by size, brightness or seeds. Each step prepares the input for the next.

Connected Terms

Share This Term
Term Connections