home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ux1.cso.uiuc.edu!jsivier
- From: jsivier@ux1.cso.uiuc.edu (Jonathon Sivier )
- Subject: Re: converting from VAX Binary
- Message-ID: <BzM955.639@ux1.cso.uiuc.edu>
- Organization: University of Illinois at Urbana
- References: <SNOW.92Dec17102651@castor.hahnemann.edu>
- Date: Mon, 21 Dec 1992 15:46:02 GMT
- Lines: 41
-
- snow@castor.hahnemann.edu (Donald C. Snow) writes:
-
- >I was just given the following problem, and I'd thought I'd check to
- >see if its been solved yet:
-
- >We have a binary image file of CT slices, complete with header
- >information and such, and we need to read it into a program.
-
- >The information we were given documents that the values stored in the
- >file are VAX binary 4-byte long integer and VAX binary 4-byte floating
- >point.
-
- >So, is there an easy way to read this into SGI type long integers and
- >floating point numbers?
-
- I have done a bit of conversion from SGI to VAX and vice-versa. The integers
- should be simple, Their byte orders will probably just be reversed. SGI uses
- Motorola byte order, the first two characters of the file shoulb be 'MM', and
- the VAX uses Intel byte order, the first two chars should be 'II'. The floating
- point is more difficult. Not only is the byte order reversed, but thats easy to
- fix, also the floating point formats are different. I tried to determine the
- format, but gave up and transfered the floating point data as ASCII, which I
- could read in and let the program convert to floating point. I'm sure
- someone knows the formats and how to convert from one to the other, but this
- was the easiest way as far as I cxould see.
-
- Good luck.
-
- Jonathan
-
- -------------------------------------------------------------------
- | Jonathan Sivier | Ballo ergo sum. |
- | jsivier@ux1.cso.uiuc.edu | (I dance therefore I am.) |
- | Flight Simulation Lab | - des Cartwright |
- | Beckman Institute | |
- | 405 N. Mathews | |
- | Urbana, IL 61801 | |
- | Work: 217/244-1923 | |
- | Home: 217/359-8225 | |
- -------------------------------------------------------------------
-
-