vol_labels_to_meshes — VOLCOLOR render op

資料種類:labelstable

呼叫: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)}``。色は

:func:vol_colorize_labels と同じパレットなので、**断面図と 3-D 表示で同じ

部品が同じ色**になる。

成分ごとに bbox を 1 ボクセル分パディングした部分体だけを切り出して

marching cubes を回す(全ボリュームを成分数だけ舐めない)。パディングは

ボリューム端に接する成分の面を閉じるためで、これをしないと端の成分だけ

穴の開いたメッシュになる。

`axes`:

• `"xyz"(既定)―― 頂点を (x, y, z) で返す。:mod:render3d` /

:mod:mesh の頂点順がこれで、`render3d.render_mesh` へ直接渡せる。

• `"zyx" ―― ボリュームの添字順のまま返す。:func:vol_label_shape_stats`

の `centroid` と同じ並びになる。

黙って取り違えると例外は出ない ―― 出るのは上下と前後が入れ替わった、

それらしい絵である。`tests/test_volcolor.py::test_mesh_axes_order_is_explicit` が

両方の重心を stats の重心と突き合わせて固定している。

*spacing* を渡すと頂点は物理座標(mm)になる。*ids* で成分を絞れる

(`None なら実在する全ラベル、ただし :data:MAX_MESHES` 件まで)。

Raises `ImportError (with the pip install scikit-image` message) when

marching cubes is unavailable, and `ValueError` for a bad *axes*, a *level*

outside `(0, 1)`, an *ids* naming an absent label, or more than

:data:MAX_MESHES components.

參考(範例資料・文獻)

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

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

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

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

voxel_labels_colorpy -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.