vreg.Volume3D.transform_affine_to#

Volume3D.transform_affine_to(target, params, center=None, coords='fixed')[source]#

Apply an affine transformation and reslice the result to the geometry of a target volume.

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

  • params (array-like) – 9-element vector with translation vector, rotation vector and stretch factors, in that order.

  • center (str or array-like, optional) – center of rotation. If this has value ‘com’ the rotation is performed around the center of mass. Alternatively this can be a 3-element vector. Defaults to None (center = origin).

  • coords (str or array, optional) – Reference frame for the coordinates of the translation, 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:

transformed volume.

Return type:

vreg.Volume3D