watershed_vol — SEGMENTATION watershed3d op

• Data kinds: voxel → labels

• Call: import fullseye as fs; fs.ledger.watershed_vol(binary, markers: 'Optional[np.ndarray]' = None, min_distance: 'float' = 1.0, method: 'str' = 'auto') -> 'np.ndarray' (to call the implementation directly, import watershed3d; watershed3d.watershed_vol(binary, markers: 'Optional[np.ndarray]' = None, min_distance: 'float' = 1.0, method: 'str' = 'auto') -> 'np.ndarray'; from the registry, opssegmentation.get("watershed_vol"))

Usage

Splits a 3D foreground into per-object labels with a watershed seeded from the distance transform (a thin composition of public ops).

The goal is to split contacts / slight overlaps that connected components would fuse into 1. The EDT is delegated to volops.vol_distance_transform and the skimage watershed to volops.vol_watershed; this module only adds (A) a pure-scipy fallback when skimage is absent and the glue for automatic seed generation. If markers is omitted, the local maxima of the distance transform (min_distance NMS) become automatic seeds.

Parameters

binary : array_like

3D foreground volume, bool or 0/1.

markers : ndarray or None

int label array when seeds are specified externally (same shape as binary, 0 = none, 1..n = seeds).

If None, generated automatically from the maxima of the distance transform.

min_distance : float

Minimum seed spacing (voxel) when markers=None.

method : {"auto", "skimage", "scipy"}

Backend selection. If "skimage" is specified but absent, fail-closed (ImportError).

Returns

labels : ndarray(int32)

Same shape as binary. Background 0, labels 1..k for each object (covering the foreground exactly).

Raises

ValueError

On invalid shape, degenerate input or invalid method (fail-closed).

Detailed usage guide

• halcon_segmentation family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• watershed3d_tour — py -3.11 examples/watershed3d_tour.py

Ops the type connects to (they accept labels as input)

—

Same category (watershed3d)

distance_peaks · separate_touching


*Provenance: watershed3d.py — SEGMENTATION operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.