comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Byte to Real conversion
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Byte to Real conversion [message #14335 is a reply to message #14334] Fri, 19 February 1999 00:00 Go to previous messageGo to previous message
David Foster is currently offline  David Foster
Messages: 341
Registered: January 1996
Senior Member
Michael A. Wirth wrote:
>
> Hi,
>
> I am reading some data in from an Magnetic Resonance image which stores
> information about the image in
> a 14336 byte header. I want to extract some of the data from this header
> and am having a problem
> with converting data to integers and reals. The integers are 2-bytes and
> the reals 4-bytes in length. How does
> one convert 4 bytes into a real number?

Michael -

Hmm, that number 14336 sure looks familiar! Are you working with
GE Signa images by any chance? I have C code that has routines to
pull out integer, byte, and float information from the header. The
main routine prints out a listing of important information from
the header. There is also a .h file that lists the offsets for
every entry in the file.

The conversion of floats does *not* look straightforward!

I'll send you an email with this code attached. I haven't had time
to port the code to IDL, so I wrote a short wrapper that spawns
the C program and returns the info in a structure. Let me know
if you're interested in this.

Hope this helps.

Dave
--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
David S. Foster Univ. of California, San Diego
Programmer/Analyst Brain Image Analysis Laboratory
foster@bial1.ucsd.edu Department of Psychiatry
(619) 622-5892 8950 Via La Jolla Drive, Suite 2240
La Jolla, CA 92037
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDL 5.2 loses shared object lib.
Next Topic: Re: How do I prevent underflow errors?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 06:27:32 PDT 2025

Total time taken to generate the page: 0.32159 seconds