Warp#
- class 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
geometryon the fixed-side domain. Each grid point maps to the world coordinate where a moving volume should be sampled (a pull-back mapping).- save(filename, fmt=None) None#
Save the warp to a file.
- Parameters:
filename (PathLike) – The path to the file to save.
fmt (str, optional) – The format of the file. If None, the format is determined by the file extension.
- as_volume() 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:
VectorField – The displacement field.