Skip to content

Warp

voxel.Warp(coordinates, geometry=None)

A dense warp of absolute world-space coordinates, held as a \((W, H, D, 3)\) tensor over the grid defined by geometry on the fixed-side domain. Each grid point maps to the world coordinate where a moving volume should be sampled (a pull-back mapping).

Parameters:

  • coordinates (Tensor or Volume) –

    World coordinate tensor of shape \((W, H, D, 3)\), or a 3-channel volume, whose geometry is adopted.

  • geometry (AcquisitionGeometry, default: None ) –

    Geometry of the underlying fixed-side grid domain.

baseshape: torch.Size property

The spatial 3D \((W, H, D)\) shape of the warp grid.

device: torch.device property

Device of the warp coordinate tensor.

as_volume() -> vx.Volume

Convert the warp to a volume of 3-channel coordinate features.

Returns:

  • Volume

    The warp coordinates as a volume.

as_displacement_field() -> VectorField

Convert to the field of world-space displacements between the warp coordinates and the identity grid.

Returns:

map(volume, mode='linear', padding_mode='zeros') -> vx.Volume

Warp a volume by sampling it at the mapped coordinates, producing a pulled-back volume on the warp grid.

Parameters:

  • volume (Volume) –

    The moving volume to warp.

  • mode (str, default: 'linear' ) –

    The sampling mode, either 'linear' or 'nearest'.

  • padding_mode (str, default: 'zeros' ) –

    Padding mode for outside grid values.

Returns:

  • Volume

    The warped volume.