views:

95

answers:

1

A description of the problem follows. You can skip to the bottom line if you're not interested.


I am working with a data file with this description:

A 109-slice MRI data set of a human head. Complete slices are stored consecutively as a 256 x 256 array. Pixels consist of 2 consecutive bytes making one binary integer. Data taken on the Siemens Magnetom and provided courtesy of Siemens Medical Systems, Inc., Iselin, NJ.

and then:

The data sets were written on a Digital Equipment Corporation (DEC) VAX computer. Each file contains only pixels, stored in row major order with 2-byte integers per pixel. To use the images on machines that have normal byte order (DECs use reverse byte order), you should swap alternate bytes, for example using the 'dd' command in UNIX. A sample command that does this for the 3dknee data set is:

% dd if=3dknee of=3dknee.new conv=swab

I don't know what the real values are, so I can't judge just by looking if the byte order is correct.

The Bottom line

Is the byte order of a DEC VAX the same as in IA-32, or reversed?

+1  A: 

According to this page and this page, the VAX and x86 both use little-endian byte order. So no conversion should be needed.

Eric Petroelje