fullseye

vol_resize — 3D geom_transform op

使い方

Resample a volume to a new grid (scipy.ndimage.zoom, cell semantics).

Exactly one of factor / shape selects the target grid:

Sampling uses grid_mode=True (cell semantics): a voxel is a cell, so an integer upscale f maps input voxel i exactly onto the output block [f*i, f*(i+1)) (exact at order=0), and the volume’s physical extent is preserved by the recomputed spacing — not the endpoint-aligned convention of scipy’s grid_mode=False default.

mode / cval set how samples that fall outside the input cells (the outer half-voxel shell of every upscale at order >= 1) are filled. The default "nearest" extends the border voxel, so a constant volume resizes to the same constant and a ramp keeps its end values. Until 2026-09-03 the call was hard-wired to "grid-constant" with cval=0, which blended the outer shell toward 0 — an upscale x2 of an all-ones volume came back with min = 0.42 on its faces, an artefact that then leaked into every downstream measurement. Other accepted modes: "reflect", "mirror", "grid-mirror", "grid-wrap", and "grid-constant" (with cval) when a zero-padded border is genuinely wanted. "constant" / "wrap" are rejected with a hint (scipy needs the grid- variants here).

The return shape depends on spacing:

order is the spline degree (exact integer 0..5; 0 = nearest — the choice for masks / labels, 1 = trilinear — the grey-value default; >1 can overshoot, see the module notes). Shrinking aliases (no band-limiting) — mean-pool with :func:volops.volume_downsample first for large reductions.

Raises ValueError when both or neither of factor / shape are given, or when the output would exceed MAX_VOXELS (checked before any allocation — a huge factor cannot balloon memory).

参考(サンプルデータ・文献)

実行できる例(この op を実際に呼ぶ検証済みサンプル)

型が繋がる次の op(voxel を入力に取れる)

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

同カテゴリ(geom_transform)

vol_rotate · vol_affine


Provenance: volxform.py — 3D operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。

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