vol_label_palette — VOLCOLOR palette op

Data kinds: nonematrix (an op determined by its arguments alone — it takes no image or data input)

Call: import volcolor; volcolor.vol_label_palette(n_labels, seed: 'int' = 0, background=(0.0, 0.0, 0.0)) (or opsvolcolor.get("vol_label_palette"))

Usage

An RGB palette for labels `0..n_labels: (n_labels + 1, 3)` float64.

> The detailed description below is the original text — the summary and the headings are translated.

:func:imgio.colorize_labels同じ乱数列である ――

`np.random.default_rng(seed).random((n + 1, 3)) の行 k がラベル k` の

色、行 0 は *background*(既定は黒 = 2-D 側と同一)。PCG64 の標本列は逐次

生成なので `n` を増やしても先頭行は変わらず、**同じラベル番号・同じ seed なら

2-D の 1 枚でも 3-D のボリュームでも色が一致する**。この一致は

`tests/test_volcolor.pynp.array_equal` で固定している。

実測(seed=0、RGB ユークリッド距離、取りうる最大は sqrt(3)=1.732):最近接の

色対の距離は 16 色で 0.1439、64 色で 0.0385、256 色で 0.0274。**色は識別子では

なく目印**であり、区別が要る図には :func:vol_label_legend の表を添える。

Raises `ValueError` for a negative / non-integer *n_labels*, an *n_labels*

over :data:MAX_LABELS, a negative *seed*, or a *background* outside [0, 1].

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_colorpy -3.11 examples/voxel_labels_color.py

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

Same category (palette)


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