vol_rle_decode — 3D rle_region op

• Data kinds: rle_region → voxel

• Call: import fullseye as fs; fs.ledger.vol_rle_decode(region) -> 'np.ndarray' (to call the implementation directly, import volregion; volregion.vol_rle_decode(region) -> 'np.ndarray'; from the registry, ops3d.get("vol_rle_decode"))

Usage

Decode a VolRLE back to a dense (D, H, W) float64 {0, 1} volume.

Exact inverse of vol_rle_encode (bit-identical round trip). The region is validated first, so a corrupted RLE raises ValueError instead of writing out of bounds.

Procedure: into an int8 cumulative buffer of (D*H, W+1), add +1 at each run's start and -1 at its end (np.add.at); positions where the cumulative sum along x is > 0 become foreground. Even if overlapping runs are passed, they do not cancel each other out in the addition (count > 0 means foreground).

Returns: float64 of (D, H, W), with values 0.0 / 1.0 only. shape is taken from region.shape, so the original volume is not needed.

Validation (ValueError): not a VolRLE / shape not of length 3, empty, or over MAX_VOXELS / length mismatch among rows, starts, ends / not an integer dtype / row id outside 0..D*H-1 / a run with start < 0, end > W or end <= start. Hand-made RLE and RLE read from outside are also fully checked before allocation.

Where to use it: decode only right before processing that cannot be done on runs (filters, morphology, vol_label etc.), and convert the result back with vol_rle_encode.

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 voxel as input)

voxel_to_mips · voxel_to_mesh · signed_distance_field · to_points · sobel3d · hessian3d · curvature_maps · edt_jfa

Same category (rle_region)

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