'Set rotation and translation params from a transformation matrix.
Parameters
head_mri_trans : array, shape (4, 4)
Transformation matrix from head to MRI space.'

def set_trans(self, head_mri_trans):

    (x, y, z) = (- self.mri_origin[0])
    mri_tgt_trans = translation(x, y, z)
    head_tgt_trans = np.dot(mri_tgt_trans, head_mri_trans)
    (x, y, z) = self.hsp.nasion[0]
    src_hsp_trans = translation(x, y, z)
    src_tgt_trans = np.dot(head_tgt_trans, src_hsp_trans)
    (rot_x, rot_y, rot_z) = rotation_angles(src_tgt_trans[:3, :3])
    (x, y, z) = src_tgt_trans[:3, 3]
    self.rot_x = rot_x
    self.rot_y = rot_y
    self.rot_z = rot_z
    self.trans_x = x
    self.trans_y = y
    self.trans_z = z
