sobel3d — 3D feature op

• 資料種類:voxel → gradient

• 呼叫: import fullseye as fs; fs.ledger.sobel3d(vol, device='cpu')(要直接呼叫實作,import match3d; match3d.sobel3d(vol, device='cpu');從台帳取用則 ops3d.get("sobel3d"))

• 經台帳呼叫的回傳值: fullseye.ledger.sobel3d(...) 只回傳宣告的 out 型別 gradient 的值(底層函式還會回傳輔助資訊)。需要被捨棄的部分時,請用 fullseye.ledger.sobel3d.raw(...),或直接呼叫 match3d.sobel3d。

• GPU:該運算子有 GPU 路徑(device="cuda")

用法

3D 梯度 (gz,gy,gx)。導數[-1,0,1]×平滑[1,2,1] 的可分離 conv3d。

vol 既可以是 numpy 也可以是 torch tensor(在 GPU 上也可)(用於 scene_flow 等常駐 device 的情境)。

回傳值為 3 個 torch tensor(不是 numpy),各為 (1,1,D,H,W) float32,位於 device 上。gz 是軸 0 方向、gy 是軸 1、gx 是軸 2 的微分(輸入為 (D,H,W) 時即 (depth,row,col) 順序)。要轉回 numpy 用 g[0, 0].cpu().numpy()。

增益: 微分 [-1,0,1] (斜率 1 時為 2)× 其他 2 軸的平滑 [1,2,1] (各 4),得到 真實梯度的 32 倍 (不正規化)。需要真實值時除以 32(curvature_maps / scene_flow_lk 在內部已經除過。hessian3d 的增益為 1,混用時要注意)。邊緣用 replicate padding(不在邊界產生虛假邊緣)。tensor 輸入為 3-D 時補上 batch 維, 為 5-D 時原樣使用。dtype 降為 float32。

後續: curvature_maps / match_shape_3d 的單位梯度、hough_plane_3d 的法線。不需要方向的邊緣強度也可用 morph_gradient3d 替代。

參考(範例資料、文獻)

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

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

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

• diff_features — py -3.11 examples_3d/diff_features.py

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

fuse_to_voxel

同類別(feature)

hessian3d · curvature_maps · edt_jfa · edt_jfa_vector · vol_frangi · vol_local_std · vol_local_thickness · vol_orientation_coherence


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

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