rle_region oprle_region × rle_region → rle_regionimport fullseye as fs; fs.ledger.vol_rle_union(a, b) (実装を直接呼ぶなら import volregion; volregion.vol_rle_union(a, b)、台帳から引くなら ops3d.get("vol_rle_union"))Union of two RLE regions, computed on the runs (no decode). Cost scales
with the run counts, not the voxel counts — merging two 5123 masks never touches 5123 anything. Regions must share the same volume shape.
手順(_rle_boolean 共通): 両 region の run を、平面行ごとに W + 1 の
stride を取った 1 本の整数直線に写し(+1 の隙間で隣の行の run が結合しない)、
各 run の start/end をイベントとして並べ、区間ごとの被覆状態 (a の内側, b の内側)
を掃引して ia | ib が真の区間を最大長の run にまとめ直す。計算量は run 数
n に対して O(n log n)(np.unique のソート)。
返り値: 同じ shape の新しい VolRLE(run は行順・x 昇順、隣接・重複する run は
1 本に併合済み)。両方が空なら run 0 本の region。
vol_rle_decode(union) == decode(a) | decode(b) が voxel 単位で成り立つ。
検証(ValueError): どちらかが VolRLE でない・整合性検査に失敗 /
a.shape != b.shape(別の volume に住む region は合成できない)。
py -3.11 examples_3d/rle_region_efficiency.pyrle_region を入力に取れる)vol_rle_decode · vol_rle_volume · vol_rle_bbox · vol_rle_centroid · vol_rle_intersect · vol_rle_difference · fuse_to_voxel
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. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.