| I am pondering the use of PCs for SPM99. I have discovered a problem right
| off the bat. I have fMRI data from a SUN system and transferred to the
| Windows NT machine to verify the operation on the PC. I am unable to read
| it. The SPM99b knows that it is little endian but it can't figure out that
| the data is big endian. I have gone into the hdr edit function and told it
| that it is big endian. I suspect that SPM99-PC can not even read the header
| file.
It works for us. The only problem we have had is when structures created
by spm_vol are saved to a file on one architecture and loaded again from
a machine with another architecture. This is why stats results created on
a Sun can not be read from a PC. This is fixed in the final SPM99 release.
When SPM99b reads an image header (via spm_hread.m), it first of all checks
the sizeof_hdr field. On a ".hdr" without byte-swapping, this field
is normally set to 348 (which is the size of an ANALYZE ".hdr" file).
If 348 is byte swapped, it becomes 1543569408. In order to see if an image
needs to be byte-swapped, SPM99b checks to see if the ".hdr" is byte
swapped by seeing if the sizeof_hdr field is set to 1543569408. I would
guess that your Sun data is being incorrectly read from a PC because the
sizeof_hdr field is not set to 348.
| Do I have to pass all the UNIX data through a byteswap module?
Operations will be slightly faster if the files do not need to be byte-
swapped each time they are read (particularly when sinc interpolation is
being used). However, providing the ".hdr" files are set up properly,
then this pre-processing should not really be necessary.
| Matlab on a little endian machine has the ability to open the file with the
| understanding that it is written in the big endian format. Is it possible
| to use this or are all the files memory mapped so that it won't help?
Reading images is not done using the Matlab fread command, although it is
useful for reading the headers (but only recently because previous Matlab
versions got it wrong). All images are read using the mex routines that
use memory mapping. Extra code was written to deal with byte-swapping the
data.
| Is there a preferred c compiler to mex-ify my own code?
We used the Sun C compiler to create our mex files, although gcc will also
work (providing you modify the matlab/bin/mexopts.sh, and spm_MAKE.sh).
The PC code was compiled by Matthew Brett using gcc. You may wish to
take a look at: http://www.physiol.ox.ac.uk/~mb3/gnumex20.html
for more information.
Regards,
-John
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|