Hi all
A little function I have written, endianchanger, will also update the
endian specifications for spm99 and spm2 SPM.mat files. Please see the
following page, copy the code and paste into a file that you name
endianchanger.m and place in the matlab path.
http://cbmg.tiddlyspot.com/#endianchanger%20%5B%5BArea-51%20Cognitive%20Brai
n%20Mapping%20Group%5D%5D
Darren
>-----Original Message-----
>From: SPM (Statistical Parametric Mapping)
>[mailto:[log in to unmask]] On Behalf Of Volkmar Glauche
>Sent: Thursday, September 28, 2006 2:37 AM
>To: [log in to unmask]
>Subject: Re: [SPM] moving SPM files/updating paths
>
>Dear list,
>
>in addition to Matthews explanation what endianness means, a
>short note how SPM deals with this issue:
>If you want to display a little-endian image on a big-endian
>machine or vice versa, SPM will need to swap bytes when
>reading the image voxel data.
>If you simply transfer _images_ from one machine to another,
>SPM will guess data endianness from the first 2 bytes of the
>NIfTI header when it creates a volume handle for the image
>using spm_vol. I don't know of any case where this would fail.
>If you transfer SPM.mat files things are different, because
>the image volume handles are stored in it, and not just
>filenames. The reason for this is that SPM stores scaling
>information in the volume handles which may be different from
>the original image scaling. Therefore SPM will skip the check
>for data endianness, and this will result in not swapping
>bytes even if your SPM.mat has been moved from one endianness
>to the other. You will notice this if you compare the image
>data type as returned by spm_vol to the image data type as
>stored in the corresponding structure within SPM.mat. Or, if
>your stats listing returns unexpectedly wild variations in
>T/F/p values...
>
>Cheers,
>
>Volkmar
>
>
>On Wed, 27 Sep 2006, Matthew Brett wrote:
>
>> On 9/27/06, Tobias Egner <[log in to unmask]> wrote:
>> > Actually, my issues did indeed turn out to be a big/little endian
>> > (who came up with that name?) problem
>>
>> I think it's a reference to Gulliver's travels:
>>
>> http://www.netrino.com/Publications/Glossary/Endianness.html
>>
>> The origin of the odd terms big endian and little endian can
>be traced
>> to the 1726 book Gulliver's Travels, by Jonathan Swift. In
>one part of
>> the story, resistance to an imperial edict to break soft-boiled eggs
>> on the "little end" escalates to civil war. (The plot is a satire of
>> England's King Henry VIII's break with the Catholic Church.) A few
>> hundred years later, in 1981, Danny Cohen applied the terms and the
>> satire to our current situation in IEEE Computer (vol. 14, no. 10).
>>
>> Matthew
>>
>>
>>
>
>--
>Volkmar Glauche
>-
>Department of Neurology
>[log in to unmask]
>Universitaetsklinikum Freiburg Phone 49(0)761-270-5331
>Breisacher Str. 64 Fax 49(0)761-270-5416
>79106 Freiburg http://fbi.uniklinik-freiburg.de/
>
|