vreg.Volume3D.translate_to#

Volume3D.translate_to(target, translation, coords='fixed', dir='xyz')[source]#

Apply a translation and reslice the result to the geometry of a target volume.

Parameters:
  • target (vreg.Volume3D) – target volume

  • translation (array-like) – translation vector (mm) with 1, 2 or 3 elements depending on the value of dir.

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

  • dir (str, optional) – Allowed directions of the translation. The options are ‘xyz’ (3D translation), ‘xy’ (2D in-slice translation) and ‘z’ (through-slice translation). Defaults to ‘xyz’.

Returns:

transformed volume.

Return type:

vreg.Volume3D