vol_affine — 3D geom_transform op

数据种类:voxelvoxel

调用: import fullseye as fs; fs.ledger.vol_affine(vol, matrix, offset=(0, 0, 0), order=1, output_shape=None, mode='constant', cval=0.0)(要直接调用实现,import volxform; volxform.vol_affine(vol, matrix, offset=(0, 0, 0), order=1, output_shape=None, mode='constant', cval=0.0);从台账取用则 ops3d.get("vol_affine"))

用法

通用仿射重采样(`scipy.ndimage.affine_transform`)。

> 以下的详细说明为原文 —— 摘要与标题已翻译。

Convention (pinned — read this before writing a matrix): this is

scipy's pull (output -> input) resampler. For every output voxel at

integer coordinate `o = (z, y, x)` the result is the input interpolated

at `matrix @ o + offset`::

out[o] = vol[ matrix @ o + offset ] # (z, y, x) order, voxels

Consequences: `matrix = 2*I` makes the object appear half size (each

output step strides two input voxels); `offset = (1, 2, 3)` moves the

object by `(-1, -2, -3)`. To *push* content through a forward transform

`T (the pose from a registration), pass the **inverse** of T`. The

test suite machine-pins this direction.

*matrix* is either a `(3, 3)` linear part (with *offset* a separate

length-3 translation) or a `(4, 4)` homogeneous matrix

`[[A, t], [0, 0, 0, 1]] — then A / t` are taken from the matrix,

the bottom row must be exactly `(0, 0, 0, 1)`, and *offset* must stay at

its zero default (a second translation would be ambiguous). Any other

shape raises `ValueError`.

*output_shape* defaults to the input shape; an explicit one is cap-checked

against `MAX_VOXELS` before allocation. *order* is the spline degree

(exact integer 0..5). Voxels whose source coordinate falls outside the

input are filled per *mode*/*cval*.

Returns a float64 volume of *output_shape*.

参考(示例数据・文献)

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

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

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

vol_geometry_transformpy -3.11 examples_3d/vol_geometry_transform.py

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

voxel_to_mips · voxel_to_mesh · signed_distance_field · to_points · sobel3d · hessian3d · curvature_maps · edt_jfa

同类别(geom_transform)

vol_resize · vol_rotate


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

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