labels_to_indices — REPRCONV index op

Data kinds: labelsindices

Call: import reprconv; reprconv.labels_to_indices(labels) (or opsreprconv.get("labels_to_indices"))

Usage

`labels → the indices (N,) of the non-background. The other direction of :func:indices_to_labels`.

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

2-D 以上のラベル画像も受ける —— その場合の添字は

**`labels.ravel() への添字**(C 順)である。np.unravel_index` で

座標へ戻せるが、戻すには元の shape が要るので、この向きは

`shape` を捨てている(不可逆)。

Args:

labels: 任意次元の整数/実ラベル配列。

Returns:

(N,) int64。ラベルが 0 でない位置の平坦添字(昇順)。

Raises:

ValueError: 空 / 非有限 / 非背景が 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)

representation_conversionpy -3.11 examples/representation_conversion.py

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

indices_to_labels · select_points

Same category (index)

indices_to_labels · select_points


*Provenance: reprconv.py — REPRCONV 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.