vreg.Volume3D.reslice#

Volume3D.reslice(affine=None, orient=None, rotation=None, center=None, spacing=1.0, coords='fixed')[source]#

Reslice the volume.

Parameters:
  • affine (array, optional) – 4x4 affine array providing the affine of the result. If this is not provided, the affine array is constructed from the other arguments. Defaults to None.

  • orient (str, optional) – Orientation of the volume. The options are ‘axial’, ‘sagittal’, or ‘coronal’. Alternatively the same options can be provided referring to the orientation of the image planes: ‘xy’, ‘yz’ or ‘zx’. If None is provided, the current orientation of the volume is used. Note while ‘xy’ and ‘yz’ mean exactly the same as ‘axial’ and ‘sagittal’, respectively, ‘zx’ differs from coronal in the orientation of the z-axis. While ‘zx’ forms a right-handed reference frame, ‘coronal’ is left-handed following the common convention in medical imaging. Defaults to None.

  • rotation (array, optional) – 3-element array specifying the rotation relative to orient, or relative to the current orientation of the volume (if orient is None). Defaults to None.

  • center (array, optional) – 3-element array specifying the rotation center of the new reference frame, in case a rotation is provided. Defaults to None.

  • spacing (float, optional) – Pixel spacing in mm. Can be a 3D array or a single scalar for isotropic spacing. Defaults to 1.0.

  • coords (str or array, optional) – Reference frame for the coordinates of the rotation and center vector, as a 4x4 affine array. String options are shorthand notations: ‘fixed’ (patient reference frame), and ‘volume’ (volume reference frame). Defaults to ‘fixed’.

Returns:

resliced volume

Return type:

Volume3D