> It appears that spm_create_vol would never allow the creation of a byte
> swapped file of any type other than int8, uint16, uint32, although these
> get converted to uint8, int16 and int32. Is there a specific reason for
> this?
Datatypes of 128+2, 128+4 and 128+8 are not proper Analyze file formats,
so they get converted to their signed/unsigned counterparts. This is all
the first piece of code does. The second piece just sets the flags for
opening the file correctly.
Best regards,
-John
> In spm_create_vol.m, lines 83-96
> mach = 'native';
> dt = spm_type(spm_type(V.dim(4)));
> if any(dt == [128+2 128+4 128+8]),
> %[satra] only int8,uint16,uint32
> % Convert to a form that Analyze will support
> dt = dt - 128;
> if spm_type(V.dim(4),'swapped')
> dt = dt*256;
> end;
> end;
> V.dim(4) = dt;
>
> if spm_type(V.dim(4),'swapped')
> if spm_platform('bigend'), mach = 'ieee-le'; else, mach =
> 'ieee-be'; end;
> end;
--
Dr John Ashburner.
Functional Imaging Lab., 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
|