NiBabel

Access a cacophony of neuro-imaging file formats

Previous topic

nibabel.eulerangles.mat2euler

Next topic

nibabel.funcs

Reggie -- the one

nibabel.eulerangles.quat2euler

nibabel.eulerangles.quat2euler(q)

Return Euler angles corresponding to quaternion q

Parameters:

q : 4 element sequence

w, x, y, z of quaternion

Returns:

z : scalar

Rotation angle in radians around z-axis (performed first)

y : scalar

Rotation angle in radians around y-axis

x : scalar

Rotation angle in radians around x-axis (performed last)

Notes

It’s possible to reduce the amount of calculation a little, by combining parts of the quat2mat and mat2euler functions, but the reduction in computation is small, and the code repetition is large.