vol_rle_difference — 3D rle_region op

• Data kinds: rle_region × rle_region → rle_region

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

Usage

Set difference a \ b on the runs (no decode).

The region of voxels contained in a and not in b. With the sweep engine (_rle_boolean), the intervals whose per-interval coverage state is ia & ~ib are kept as runs. Non-commutative (vol_rle_difference(a, b) != vol_rle_difference(b, a)). The cost is O(n log n) in the number of runs.

Returns: a new VolRLE with the same shape. If a is completely contained in b, a region with 0 runs. vol_rle_decode(result) == decode(a) & ~decode(b) holds voxel by voxel.

Validation (ValueError): either one is not a VolRLE or fails the run-array consistency check / a.shape != b.shape.

Where to use it: "subtractions" such as removing what lies outside the ROI or a known component (1 of vol_rle_components) from the whole mask, or making a shell from the difference between vol_rle_encode(mask) and the erode result, done without building a dense array.

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_union · vol_rle_intersect · fuse_to_voxel

Same category (rle_region)

vol_rle_encode · vol_rle_decode · vol_rle_volume · vol_rle_bbox · vol_rle_centroid · vol_rle_union · vol_rle_intersect · 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.