NiBabel

Access a cacophony of neuro-imaging file formats

Previous topic

nibabel.quaternions.quat2mat

Next topic

nibabel.spatialimages

Reggie -- the one

nibabel.quaternions.rotate_vector

nibabel.quaternions.rotate_vector(v, q)

Apply transformation in quaternion q to vector v

Parameters:

v : 3 element sequence

3 dimensional vector

q : 4 element sequence

w, i, j, k of quaternion

Returns:

vdash : array shape (3,)

v rotated by quaternion q

Notes

See: http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#Describing_rotations_with_quaternions