Skip to content

Segmentation Cleanup Module Guide ​

The Segmentation Cleanup module corrects and measures a labeled segmentation stack in one integrated editor: paint fixes by hand, run automated cleanup over the whole volume, quantify the result per class, and save it as a new file. All edits run against a server-side working copy — the original file is never modified.

For a conceptual overview, see Segmentation Cleanup Module.

Segmentation Cleanup step 1Segmentation cleanup module landing page showing step navigation and file selector


Quick Start ​

  1. Launch module — Click "Segmentation Cleanup" from the workspace hub
  2. Select — Choose a segmentation result or annotation mask
  3. Edit — Paint corrections and/or configure automated cleanup, then Apply
  4. Quantify — Review per-class metrics; export a CSV report if needed
  5. Save as New File — The cleaned stack becomes a tracked output usable by Mesh Generation and Stitching

Step-by-Step Guide ​

Step 1: Selecting a Segmentation ​

SourceDescription
Segmentation ResultsLabel maps from U-Net inference, and prior cleanup outputs
Annotation MasksAnnotation uploads and completed annotations from the Annotation Tool
Test DataThe built-in annotation test stack

Requirements: multi-page TIFF with integer class labels (0 = background) and at least one non-zero class.

Once selected, each detected class is shown as a chip with its color, value, and approximate voxel count. Two things worth checking here:

  • Voxel size — without one, quantification reports voxel counts only. Set it via the File Browser's file info dialog to get physical volume and surface area.
  • Image underlay — when the segmentation's lineage points to a grayscale origin image, it is resolved automatically and used as the underlay in the editor (optional; editing works without it).

See Selecting a Segmentation.


Step 2: Edit & Quantify ​

Painting, automated cleanup, and quantification live side by side in one step.

Painting Corrections ​

ToolAction
BrushPaint with the active class
EraserErase to background (0)
FillFlood-fill the clicked connected region with the active class

Brush size: 1–100 px (slider). Left-drag paints; right-drag or Space+drag pans; mouse wheel zooms. Undo/redo is tracked per slice, so stepping between slices keeps each slice's own history. Labels are drawn as a colored overlay on the grayscale underlay. See Painting Corrections.

Automated Cleanup ​

Configure any combination, then Apply cleanup — it runs on the full stack (including unsaved paint edits) and the editor reloads from the result:

OperationOptions
Merge or remove classesPer class: keep / remove (to background) / merge into another class
Fill holesoff / 2D (per slice) / 3D
Min sizeRemove 3D connected components below N voxels (0 = off)
SmoothMajority-filter boundary smoothing, radius 0–5 (0 = off)

Operations always run in a fixed order (merge → fill → remove small → smooth), and fill/smoothing only claim background voxels — they never overwrite another class's foreground. See Automated Cleanup.

Quantification and Reports ​

The table below the viewer reports per class: voxels, physical volume (when a voxel size is set), objects (3D connected components), mean/largest component size, and surface area (marching cubes).

When you paint, the metrics go stale — a "labels edited" badge appears with an Update button. Applying cleanup recomputes them automatically.

Create report (CSV) writes two tracked files: report.csv (per-class summary) and objects.csv (one row per connected component). See Quantification and Reports.

Saving the Result ​

Save as New File writes the current labels (painted edits + applied cleanup) to a new TIFF (default name cleaned), tagged as a segmentation result so Mesh Generation and Stitching accept it directly. Saving does not end the session — you can keep editing and save again. See Saving the Result.

Segmentation edit step wit tools and automated cleanup sectionsSegmentation edit step wit tools and automated cleanup sections


Output Files ​

OutputDescription
Cleaned segmentationNew tracked TIFF, tagged as a segmentation result
report.csvPer-class quantification summary
objects.csvOne row per individual connected component

Working copies are cleaned up when you leave the module; saved files and reports remain.


Troubleshooting ​

IssuePossible CauseSolution
No physical volume / surface area columnsNo voxel size on the inputSet it via the File Browser's file info dialog, then reselect
No grayscale underlay in the editorLineage doesn't point to a grayscale originEditing still works — the label stack backs the view
Metrics don't match what I seeLabels edited since last computePress Update next to the "labels edited" badge
Apply cleanup does nothingNo operation configuredAt least one operation must be set before applying
Small structures disappeared after cleanupMin size set too highLower the min-size threshold and re-run from the last save
Undo doesn't undo an edit on another slicePer-slice historyNavigate to the slice where the edit happened, then undo

Part of DFG Priority Programme SPP2332 "Physics of Parasitism"