fullseye

vol_rle_centroid — 3D rle_region op

使い方

Centroid (z, y, x) of the region, computed on the runs (no decode).

Each run contributes n voxels at its row’s (z, y) and mean x (start + end - 1) / 2 — the exact arithmetic mean of the member voxel indices, so it matches the dense centroid to floating-point accuracy. Pass spacing (sz, sy, sx) for physical coordinates. An empty region raises ValueError.

返り値: (z, y, x) の 3 つの float(depth, row, col 順)。spacing 無しなら voxel index 単位(index の算術平均そのもの)、spacing を渡すと各成分に (sz, sy, sx) を掛けた物理座標(mm など、spacing と同じ単位)。spacing は 長さ 3 の正の有限値、または spacing_mm 属性を持つ volio.VolumeMeta

検証(ValueError): VolRLE の整合性検査 / run が 0 本 / spacing が 長さ 3 でない・非正・非有限。

注意: 質量中心ではなく voxel の幾何重心(全 voxel 等重み)。gray 値で重み付けした 重心が欲しい場合は vol_rle_decode してから自分で計算する。

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(position を入力に取れる)

refine_peak_newton · refine_translation_lk · refine_lm · fuse_to_voxel

同カテゴリ(rle_region)

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