vol_rle_centroid — 3D rle_region op

資料種類:rle_regionposition

呼叫: import fullseye as fs; fs.ledger.vol_rle_centroid(region, spacing=None)(要直接呼叫實作,import volregion; volregion.vol_rle_centroid(region, spacing=None);從台帳取用則 ops3d.get("vol_rle_centroid"))

用法

在 run 上計算區域的重心 `(z, y, x)`(不解碼)。

> 以下的詳細說明為原文 —— 摘要與標題已翻譯。

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` してから自分で計算する。

參考(範例資料・文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

可執行的範例(實際呼叫該運算子並已驗證的樣例)

rle_region_efficiencypy -3.11 examples_3d/rle_region_efficiency.py

型別可銜接的下一個運算子(可接受 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 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.