rle_region opvoxel → rle_regionimport fullseye as fs; fs.ledger.vol_rle_encode(vol_binary) -> 'VolRLE' (実装を直接呼ぶなら import volregion; volregion.vol_rle_encode(vol_binary) -> 'VolRLE'、台帳から引くなら ops3d.get("vol_rle_encode"))Encode a binary volume as x-runs (the 3-D HALCON-region representation).
A non-{0, 1} input is thresholded at > 0.5 (the :mod:volops
convention). NaN / Inf are rejected. An empty mask encodes to zero runs —
a valid region that decodes back to all-background.
Memory: proportional to the number of runs (~surface complexity per plane row), not to the voxel count — measured 1/145 of the dense bool mask on a realistic 384**3 part.
何を作るか: (D, H, W) のバイナリ volume を、x 軸(最終軸)方向の連続前景区間
(run)の列に変換する。VolRLE は rows(平面行 id z*H + y、int32、昇順)、
starts / ends(run の x 範囲 [start, end)、end は排他的)、shape
(元の (D, H, W))を持つ frozen dataclass。run i は
vol[z, y, starts[i]:ends[i]] を表す。
引数と検証(fail-closed):
vol_binary: 3-D 配列。bool ならそのまま、それ以外は float64 に変換して
NaN/Inf があれば ValueError、> 0.5 で二値化する。MAX_VOXELS(1 << 27 ≈ 1.34 億)を超えると
ValueError。VolRLE になる(エラーではない)。注意: 軸順は [z, y, x](depth, row, col)。run は x 方向にしか走らないので、
x 方向に細かく途切れる形状(縞・ノイズ)ほど run 数が増え、圧縮の利点は減る。
vol_rle_volume / vol_rle_bbox / vol_rle_centroid は decode せずに
run 上で答える。集合演算は vol_rle_union / vol_rle_intersect /
vol_rle_difference、密配列へ戻すのは vol_rle_decode。
py -3.11 examples_3d/rle_region_efficiency.pyrle_region を入力に取れる)vol_rle_decode · vol_rle_volume · vol_rle_bbox · vol_rle_centroid · vol_rle_union · vol_rle_intersect · vol_rle_difference · fuse_to_voxel
rle_region)vol_rle_decode · 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. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.