vol_rle_union — 3D rle_region op

• Data kinds: rle_region × rle_region → rle_region

• Call: import fullseye as fs; fs.ledger.vol_rle_union(a, b) (to call the implementation directly, import volregion; volregion.vol_rle_union(a, b); from the registry, ops3d.get("vol_rle_union"))

Usage

Union of two RLE regions, computed on the runs (no decode).

Cost scales with the run counts, not the voxel counts — merging two 512**3 masks never touches 512**3 anything. Regions must share the same volume shape.

Procedure (shared _rle_boolean): the runs of both regions are mapped onto 1 integer line with a stride of W + 1 per plane row (the +1 gap keeps runs of neighbouring rows from joining), each run's start/end is listed as an event, and the per-interval coverage state (inside a, inside b) is swept, regrouping the intervals where ia | ib is true into maximal-length runs. The cost is O(n log n) in the number of runs n (the sort in np.unique).

Returns: a new VolRLE with the same shape (runs in row order, ascending x, adjacent and overlapping runs already merged into 1). If both are empty, a region with 0 runs. vol_rle_decode(union) == decode(a) | decode(b) holds voxel by voxel.

Validation (ValueError): either one is not a VolRLE or fails the consistency check / a.shape != b.shape (regions living in different volumes cannot be combined).

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.

Runnable examples (verified samples that actually call this op)

• rle_region_efficiency — py -3.11 examples_3d/rle_region_efficiency.py

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

vol_rle_decode · vol_rle_volume · vol_rle_bbox · vol_rle_centroid · vol_rle_intersect · vol_rle_difference · fuse_to_voxel

Same category (rle_region)

vol_rle_encode · vol_rle_decode · vol_rle_volume · vol_rle_bbox · vol_rle_centroid · vol_rle_intersect · vol_rle_difference · vol_rle_components


*Provenance: volregion.py — 3D 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.