indices_to_labels — REPRCONV index op

資料種類:indiceslabels

呼叫:import reprconv; reprconv.indices_to_labels(indices)(或 opsreprconv.get("indices_to_labels"))

用法

索引 `(N,) → 選擇遮罩 labelsindices` 的出口(可逆)。

> 以下的詳細說明為原文 —— 摘要與標題已翻譯。

`max(indices) + 1` 長の 1-D ラベル配列を作り、選ばれた位置に 1 を置く。

`indices -> labels -> indices` は bit 一致(重複と順序を除く)。

逆向き `labels -> indices -> labels` は末尾の背景を落とす

(長さが `max_index + 1` に切り詰まる)—— これは情報の損失であって

バグではないので、:func:labels_to_indices の docstring に量を書いてある。

Args:

indices: (N,) の非負整数配列。

Returns:

(max + 1,) の int64 ラベル配列(選択 = 1、背景 = 0)。

Raises:

ValueError: 1-D でない / 負 / 空 / 上限超。

參考(範例資料・文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

• 演算法的正典(作者・年份)與用途見上面的族使用指南

可執行的範例(實際呼叫該運算子並已驗證的樣例)

representation_conversionpy -3.11 examples/representation_conversion.py

型別可銜接的下一個運算子(可接受 labels 作為輸入)

labels_to_indices

同類別(index)

labels_to_indices · select_points


*Provenance: reprconv.py — REPRCONV 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

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