home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / sgi / misc / 57 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.3 KB  |  52 lines

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