vol_label_legend — VOLCOLOR measure op

• Data kinds: labels → table

• Call: import fullseye as fs; fs.ledger.vol_label_legend(labels, props=None, seed: 'int' = 0, spacing=None, measure: 'str' = 'volume', top=None) (to call the implementation directly, import volcolor; volcolor.vol_label_legend(labels, props=None, seed: 'int' = 0, spacing=None, measure: 'str' = 'volume', top=None); from the registry, opsvolcolor.get("vol_label_legend"))

Usage

A legend table: which colour is which component, and what its measurements are.

An op so that figures are not made that show only colours whose meaning cannot be read. Returns list[dict]:

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

voxel_count · volume · measure name of the quantity used for sorting ·

value its value · rank 1-based rank · share fraction of the

*measure* total over all components.

*measure* may be any numeric key present in props ("volume" "voxel_count" "equivalent_diameter", and "sphericity" too if volops.vol_region_props was passed). Sorted in descending order, ties broken by ascending label number (deterministic). Given *top*, only the top N are returned.

Labels that exist are taken from the non-zero entries of np.bincount. labels.max() is not taken as the component count, so gaps in the numbering do not upset either the count or the ranks (tests/test_volcolor.py::test_stats_do_not_invent_the_component_count_from_max).

Raises ValueError when *measure* is not a numeric key of *props*, when *props* does not cover the labels present, or on a bad *top*.

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• voxel_labels_color — py -3.11 examples/voxel_labels_color.py

Ops the type connects to (they accept table as input)

—

Same category (measure)

vol_label_shape_stats


*Provenance: volcolor.py — VOLCOLOR operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

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