voxel_to_hessian — REPRCONV derivative op

• 数据种类:voxel → hessian

• 调用: import fullseye as fs; fs.ledger.voxel_to_hessian(vol, sigma=1.0, scale_normalize=False)(要直接调用实现,import reprconv; reprconv.voxel_to_hessian(vol, sigma=1.0, scale_normalize=False);从台账取用则 opsreprconv.get("voxel_to_hessian"))

• GPU:无(仅 CPU 参考实现)

用法

体 voxel → 3-D Hessian hessian 的 6 个分量 (zz, yy, xx, zy, zx, yx)。仅用 numpy 与 scipy 构建的 hessian 类型的入口。

返回与 hessian3d(torch 的 conv3d)相同的形式: 长度为 6 的 list,各为 (D,H,W) float32, 顺序为 (zz, yy, xx, zy, zx, yx)(轴 0=z, 1=y, 2=x),单位为 1/voxel²,边缘 replicate (scipy.ndimage 的 mode="nearest")。因此 hessian_determinant / hessian_vesselness 可直接读取,即使在没有 torch 的纯 pip install fullseye 中, voxel → hessian → voxel 的链也能接通。

sigma 是高斯平滑的尺度(voxel)。对角分量为「该轴的 2 阶 × 其他 2 轴的平滑」,交叉分量为「2 个轴的 1 阶 × 其余轴的平滑」的可分离卷积。核为高斯导数的形状,其和与 1 阶、2 阶矩严格对齐(采样的高斯导数核之和不为 0,亮度会泄漏到 2 阶导数中),因此对 2 次多项式 ½xᵀAx + bᵀx,内部在舍入范围内得到 H = A。sigma=0 不是"无平滑",而是与 hessian3d 相同的 3 抽头核([1,−2,1] / [−0.5,0,0.5] / [1,2,1]/4)—— 与 torch 版在 float32 舍入范围内一致。scale_normalize=True 时乘以 σ²(Lindeberg 的 γ=1 归一化。用于跨尺度比较数值。与 vol_frangi 内部 Hessian 的约定相同)。

不接受 2-D 图像: hessian 类型是 3-D 的 6 个分量,接收方也需要 (D,H,W)。2-D 的 Hessian 响应请用 sk_hessian / sk_hessian_det / xsk_hessian_eig(image → image)。

Args:

vol: 3-D 体 (D,H,W),实数,有限。

sigma: 高斯平滑的尺度(voxel)。有限且 >= 0。0 时与 hessian3d 相同的核。默认 1.0。

scale_normalize: True 时各分量乘以 σ²(不能与 sigma=0 同时使用)。

Returns:

6 个 np.ndarray 组成的 list,各为 (D,H,W) float32,顺序为 (zz, yy, xx, zy, zx, yx)。

Raises:

ValueError: 空 / 不是 3-D / 非有限 / sigma 不是有限的非负数 /

scale_normalize 与 sigma=0 同时使用。

空输入(vol 为 0 个元素)会引发 ValueError。

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

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

可运行的示例(实际调用该算子并已验证的样例)

• hessian_numpy_chain — py -3.11 examples/hessian_numpy_chain.py

类型可衔接的下一个算子(可接受 hessian 作为输入)

hessian_determinant · hessian_vesselness

同类别(derivative)

gradient_magnitude · gradient_coherence · hessian_determinant · hessian_vesselness


*Provenance: reprconv.py — REPRCONV 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

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