vol_label_palette — VOLCOLOR palette op

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

• Call: import fullseye as fs; fs.ledger.vol_label_palette(n_labels, seed: 'int' = 0, background=(0.0, 0.0, 0.0)) (to call the implementation directly, import volcolor; volcolor.vol_label_palette(n_labels, seed: 'int' = 0, background=(0.0, 0.0, 0.0)); from the registry, opsvolcolor.get("vol_label_palette"))

Usage

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

It is the same random sequence as imgio.colorize_labels -- row k of np.random.default_rng(seed).random((n + 1, 3)) is the colour of label k, row 0 is *background* (default black = identical to the 2-D side). PCG64's sample stream is generated sequentially, so increasing n does not change the leading rows, and with the same label number and the same seed the colour matches whether in 1 2-D image or in a 3-D volume. This match is pinned by tests/test_volcolor.py with np.array_equal.

Measured (seed=0, RGB Euclidean distance, maximum possible sqrt(3)=1.732): the distance of the closest colour pair is 0.1439 for 16 colours, 0.0385 for 64 colours, 0.0274 for 256 colours. Colours are not identifiers but markers; for figures that need to tell components apart, attach the table of vol_label_legend.

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

over 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_color — py -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.