acquisition#

voxel.cast_orientation(obj) → Orientation#

Cast an object to an Orientation instance.

Parameters:

obj (Orientation | str | AffineMatrix) – Object to cast.

Returns:

Orientation – The cast orientation.

voxel.cast_volume_geometry(obj) → VolumeGeometry#

Cast an object to a VolumeGeometry.

Parameters:

obj (Volume | VolumeGeometry | Warp) – Object to cast.

Returns:

VolumeGeometry – The cast geometry.

voxel.geometries_equal(a, b, tol=1e-6) → bool#

Check if two geometries are equal within a given tolerance.

Parameters:
Returns:

bool – True if the geometries are equal, False otherwise.

voxel.geometry_from_spacing(baseshape, spacing, orientation='RAS', space='world', device=None) → VolumeGeometry#

Construct an acquisition geometry with a given voxel spacing and anatomical orientation, centered at the world origin.

Parameters:
  • baseshape (Size) – The spatial shape (3D dimensions) of the acquisition.

  • spacing (float | Tensor) – Voxel spacing. An isotropic spacing is assumed if a scalar is provided.

  • orientation (Orientation | str) – Anatomical orientation of the voxel coordinate system.

  • space (Space) – Space of the spacing components. If ‘world’, components are ordered along the world axes and permuted to the corresponding grid dimensions. If ‘voxel’, they map directly to the grid dimensions.

  • device (device, optional) – Device to store the matrix on. If None, the device of the spacing tensor is used.

Returns:

VolumeGeometry – Constructed geometry.