siemens_quat_to_rot_mat

siemens_quat_to_rot_mat#

mrinufft.io.utils.siemens_quat_to_rot_mat(quat)[source]#

Calculate the rotation matrix from Siemens Twix quaternion.

Parameters:

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

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