labels_to_indices — REPRCONV index op

• 資料種類:labels → indices

• 呼叫: import fullseye as fs; fs.ledger.labels_to_indices(labels)(要直接呼叫實作,import reprconv; reprconv.labels_to_indices(labels);從台帳取用則 opsreprconv.get("labels_to_indices"))

用法

labels → 非背景的索引 (N,)。indices_to_labels 的反向。

也接受 2-D 以上的標籤影像 —— 此時的索引是 對 labels.ravel() 的索引(C 順序)。可用 np.unravel_index 還原為座標, 但還原需要原來的 shape,所以這個方向捨棄了 shape(不可逆)。

Args:

labels: 任意維度的整數/實數標籤陣列。

Returns:

(N,) int64。標籤不為 0 的位置的平坦索引(升冪)。

Raises:

ValueError: 空 / 非有限 / 連 1 個非背景元素也沒有。

參考(範例資料、文獻)

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

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

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

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

• representation_conversion — py -3.11 examples/representation_conversion.py

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

indices_to_labels · select_points

同類別(index)

indices_to_labels · select_points


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

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