vol_labels_to_meshes — VOLCOLOR render op

• 資料種類:labels → table

• 呼叫: import fullseye as fs; fs.ledger.vol_labels_to_meshes(labels, ids=None, spacing=None, seed: 'int' = 0, level: 'float' = 0.5, axes: 'str' = 'xyz')(要直接呼叫實作,import volcolor; volcolor.vol_labels_to_meshes(labels, ids=None, spacing=None, seed: 'int' = 0, level: 'float' = 0.5, axes: 'str' = 'xyz');從台帳取用則 opsvolcolor.get("vol_labels_to_meshes"))

用法

對每個成分做 marching cubes,得到一組彩色網格。

回傳 list[dict],各元素為 {"label", "vertices" (nv, 3) float64, "faces" (nf, 3) int64, "color" (r, g, b)}。顏色與 vol_colorize_labels 使用同一調色盤,所以在斷面圖與 3-D 顯示中同一零件呈現同一顏色。

對每個成分只切出把 bbox 填補 1 體素後的子體, 再執行 marching cubes(不會依成分數走訪整個體資料)。填補是為了封閉接觸體資料邊緣的成分的面,不這樣做的話,只有邊緣的成分會成為有洞的網格。

axes:

• "xyz"(預設)—— 以 (x, y, z) 回傳頂點。render3d / mesh 的頂點順序就是這樣,可直接傳給 render3d.render_mesh。

• "zyx" —— 保持體資料的索引順序回傳。與 vol_label_shape_stats 的 centroid 順序相同。

默默弄錯也不會拋例外 —— 出來的是上下與前後互換的、

看似合理的圖。tests/test_volcolor.py::test_mesh_axes_order_is_explicit

把兩者的質心與 stats 的質心對照,加以固定。

傳入 *spacing* 時頂點為物理座標(mm)。可用 *ids* 篩選成分(None 時為實際存在的全部標籤,但最多 MAX_MESHES 個)。

marching cubes 不可用時拋出 ImportError(附帶 pip install scikit-image 的提示); *axes* 不正確、*level* 在 (0, 1) 之外、*ids* 指定了不存在的標籤,或成分超過 MAX_MESHES 個時,拋出 ValueError。

參考(範例資料、文獻)

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

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

• 演算法的正典(作者、年份)與用途見上面的族使用指南。

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

• voxel_labels_color — py -3.11 examples/voxel_labels_color.py

型別可銜接的下一個運算子(可接受 table 作為輸入)

—

同類別(render)

vol_label_volume_render


*Provenance: volcolor.py — VOLCOLOR 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

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