> I would like to import SPM files (.hdr and .img -- results of fMRI
> analysis done by another group) into our application.
>
> It seems to be more difficult than I thought. I can extract certain
> information from the .hdr file (volume dimensions, voxel size, scaling
> factor etc). I believe, 3D "world" coordinates of the voxel can be
> found (how?) using a matrix saved in one of the .mat files (which one?).
> I would greatly appreciate any help. Maybe you know of, or have the
> code (C or matlab) that I could read or reuse (to essentially resample
> fMRI results into another volume). Is there any documentation that I
> should be aware of.
Take a look at the following matlab functions:
spm_vol.m - calls spm_hread and spm_vol in order to produce
a data structure that spm can work with.
spm_hread.m - reads the .hdr file
spm_get_space.m - derives the world mapping from .mat or .hdr file
spm_format.m - purely documentation.
A mapping to "world" co-ordinates are derived from the .mat file (with the
same base filename as the .hdr and .img files) if it exists. Otherwise it is
obtained (using spm_get_space.m) from the origin and voxel size fields within
the .hdr file.
Best regards,
-John
--
Dr John Ashburner.
Wellcome Department of Cognitive Neurology.
12 Queen Square, London WC1N 3BG, UK.
tel: +44 (0)20 78337491 or +44 (0)20 78373611 x4381
fax: +44 (0)20 78131420
http://www.fil.ion.ucl.ac.uk/~john
mail: [log in to unmask]
|