It might make life a lot easier if SPM just crashed whenever it encountered
header formats that do not have their handedness clearly specified.
Currently, it does all this stuff silently - assuming that images are saved
with a particular handedness as specified by the user.
If you want to see the original header information, then I suggest taking a
look at some of the code in @nifti/private. The read_hdr_raw.m function will
read the original information - although you would need to move it (and a few
other of the private functions) into a different directory.
See http://nifti.nimh.nih.gov/nifti-1 for details about the NIfTI format. It
may appear complicated, but it is extremely trivial compared to the thousands
of pages that are needed to document only some of the DICOM format(s).
A qform_code of zero indicates that handedness information can not be obtained
from the images one way. An sform_code of zero indicates that it can not be
obtained the other way. See the following for information about this:
http://nifti.nimh.nih.gov/nifti-1/documentation/nifti1fields/nifti1fields_pages/qsform.html
Note that SPM will use the sform information if available. If it isn't, then
it tries the qform. If this doesn't exist either, then it will simply assume
a default handedness - and hope that this is correct and hasn't been messed
about with. If this is specified incorrectly, then any images generated from
the originals will have their handedness wrongly specified.
Best regards,
-John
On Wednesday 05 November 2008 23:12, Rajeev Raizada wrote:
> Dear SPM list,
>
> I had been under the impression that Nifti files
> always have L-R info built-in to them, so that
> you never need to worry about interpretation-conventions etc.
>
> However, it seems that although Nifti images possess
> the *capability* of having built-in L-R info, they don't have to use it.
> An image can be in Nifti format without actually having that info built-in.
> If I open such an image in FSLview, it opens it and views it fine,
> but it says "Coordinate space: unknown",
> and does not show any L-R / A-P labels on the image view.
>
> Is there a Matlab or SPM command which can tell me
> whether a particular Nifti file has L-R info built-in to it?
> I had thought that maybe spm_get_space would do that,
> but that command gives a matrix of output without complaining,
> even when I give it a "Coordinate space: unknown" image as input.
>
> I've looked around a bit online, but the only discussions I can find
> about how L-R info gets built-in to Nifti images
> are epic poems about RAS, LAS, world-spaces and quaternions.
> Any simpler or more digestible answers would be greatly appreciated!
>
> Many thanks,
>
> Raj
|