siemens_quat_to_rot_mat

siemens_quat_to_rot_mat#

mrinufft.io.utils.siemens_quat_to_rot_mat(quat, return_det=False)[source]#

Calculate the rotation matrix from Siemens Twix quaternion.

Parameters:
  • quat (np.ndarray) – The quaternion from the Siemens Twix file.

  • return_det (bool) – Whether to return the determinent of the rotation before norm

Returns:

The affine rotation matrix which is a 4x4 matrix. This can be passed as input to affine parameter in nibabel.

Return type:

np.ndarray