vol_label_legend — VOLCOLOR measure op

• 数据种类:labels → table

• 调用: import fullseye as fs; fs.ledger.vol_label_legend(labels, props=None, seed: 'int' = 0, spacing=None, measure: 'str' = 'volume', top=None)(要直接调用实现,import volcolor; volcolor.vol_label_legend(labels, props=None, seed: 'int' = 0, spacing=None, measure: 'str' = 'volume', top=None);从台账取用则 opsvolcolor.get("vol_label_legend"))

用法

图例表:哪个颜色对应哪个成分,以及它的测量值。

为了不做出只有颜色、读不出含义的图而设的 op。返回 list[dict]:

label · rgb (r, g, b) float [0, 1] · hex "#rrggbb" ·

voxel_count · volume · measure 用于排序的量的名称 ·

value 其值 · rank 从 1 开始的名次 · share 占全部成分

*measure* 合计的比例。

*measure* 只要是 props 中的数值键都可以("volume" "voxel_count" "equivalent_diameter",若传入的是 volops.vol_region_props 则 "sphericity" 也可以)。按降序排列,同值按标签编号升序区分(确定性)。给出 *top* 时只返回前 N 个。

实际存在的标签取自 np.bincount 的非零项。不把 labels.max() 当作成分数, 所以编号有缺号也不会打乱件数和名次(tests/test_volcolor.py::test_stats_do_not_invent_the_component_count_from_max)。

当 *measure* 不是 *props* 的数值键、*props* 未覆盖实际存在的标签,或 *top* 不正确时,抛出 ValueError。

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

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

可运行的示例(实际调用该算子并已验证的样例)

• voxel_labels_color — py -3.11 examples/voxel_labels_color.py

类型可衔接的下一个算子(可接受 table 作为输入)

—

同类别(measure)

vol_label_shape_stats


*Provenance: volcolor.py — VOLCOLOR 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

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