vol_rle_volume — 3D rle_region op

• Data kinds: rle_region → measurement

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

Usage

Voxel count of the region, computed on the runs (no decode).

Measured ~300x faster than summing the dense mask.

Computation: sum(ends - starts) (the differences are taken in int64, so it does not overflow even with many runs). The return value is a Python int (voxel count, unit = voxel. If you want physical volume in mm^3, multiply by the spacing product sz*sy*sx yourself — this op does not accept spacing).

The input is validated with _require_rle before use (not a VolRLE, inconsistent shape or run arrays, out-of-range runs raise ValueError). An empty region returns 0 (not treated as an error). The purpose is to return the same value as vol_rle_decode followed by sum(), without building a dense array. Applying it to each component of vol_rle_components gives the per-component volume.

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

vol_gaussian_psf · fuse_to_voxel · fresnel_reflectance · snell_angle

Same category (rle_region)

vol_rle_encode · vol_rle_decode · 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.