Dear SPMers,
a question for you fellow nii coders (and somehow I feel John is going to answer this one). When you are not interested in the depths of nii file header encoding and specs please stop reading here, this is really boring stuff.
SPM seems to prefer working with voxel to world mappings as encoded in the srow matrix of the formal nifti file header specification (http://nifti.nimh.nih.gov/pub/dist/src/niftilib/nifti1.h ), especially the srow_x, srow_y and srow_z vectors. When a nii image has this srow information, this is signalled in the header with the bit sform_code set to 1. So far so good.
I have nii data now from some scanner where space is only encoded as a quaternion (the other way in the nifti header for defining the space of all voxels in the image), and hence the sform_code bit in the nifti header is set to 0, qform_code to 1, and srow is only the unity matrix. Still nifti specs proof, just a bit unusual to me.
SPM seems to display this image well, and a voxel to world matrix is displayed in the graphics window. How exactly does SPM compute the srow matrix from the quaternion? Does it then subsequently use sform_code=1 and the computed srow matrix for subsequent processed data? The nifti website from NIH does offer some pointers on conversions of quaternions, but not a complete description unfortunately.
I need to know as some of my own rendering code doesnt handle that specific data well, it assumes sform_code is always on and the srow fields populated (as it is for SPM data).
Thanks for your insights John (or others),
Bas
--------------------------------------------------
Dr. S.F.W. Neggers
Division of Brain Research
Rudolf Magnus Institute for Neuroscience
Utrecht University Medical Center
Visiting : Heidelberglaan 100, 3584 CX Utrecht
Room B.01.1.03
Mail : Huispost B01.206, P.O. Box 85500
3508 GA Utrecht, the Netherlands
Tel : +31 (0)88 7559609
Fax : +31 (0)88 7555443
E-mail : [log in to unmask]<mailto:[log in to unmask]>
Web : http://www.neuromri.nl/people/bas-neggers
: http://www.brainsciencetools.com (CEO)
--------------------------------------------------
------------------------------------------------------------------------------
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren. Het Universitair Medisch
Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de W.H.W.
(Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd bij
de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.
Denk s.v.p aan het milieu voor u deze e-mail afdrukt.
------------------------------------------------------------------------------
This message may contain confidential information and is intended exclusively
for the addressee. If you receive this message unintentionally, please do not
use the contents but notify the sender immediately by return e-mail. University
Medical Center Utrecht is a legal person by public law and is registered at
the Chamber of Commerce for Midden-Nederland under no. 30244197.
Please consider the environment before printing this e-mail.
|