vol_rle_difference — 3D rle_region op

Data kinds: rle_region × rle_regionrle_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 detailed description below is the original text — the summary and the headings are translated.

`a に含まれ b に含まれない voxel の region。掃引エンジン(_rle_boolean`)

で区間ごとの被覆状態が `ia & ~ib` の区間を run として残す。非可換

(`vol_rle_difference(a, b) != vol_rle_difference(b, a)`)。計算量は run 数に

対して O(n log n)。

返り値: 同じ `shape の新しい VolRLEab` に完全に含まれていれば

run 0 本の region。`vol_rle_decode(result) == decode(a) & ~decode(b)` が

voxel 単位で成り立つ。

検証(`ValueError): どちらかが VolRLE` でない・run 配列の整合性検査に失敗 /

`a.shape != b.shape`。

使いどころ: 全体マスクから ROI 外や既知の成分(`vol_rle_components` の 1 つ)を

取り除く、`vol_rle_encode(mask)` と erode 結果の差で殻を作る、といった

「引き算」を密配列を作らずに行う。

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_efficiencypy -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.