Front Page › Forums › BioMap › Analyze 7.5 › Re: Analyze 7.5
I’ve been writing a Java routine to extract relevant data from the three files you mentioned (hdr+img+t2m), but there seems to be some confusion on the number of bytes used by the data types in the files. I thought I might mention my own experiences so others can compare.
[b]img-file:[/b] You mention that this file holds a long string of signed values of 4 bytes (32-bit). This however is not always the case and depends on the particular setting of the ‘datatype’ variable in the hdr-file (offset 70). In my particular hdr-file this variable holds ‘4’ which (according to the Analyze 7.5 specs) means SIGNED_SHORT. As a short only uses 2 bytes (16-bit), the img-file will be only half as large. Of course, this all depends on the particular settings used when writing the files. Best to interpret the hdr-file first…
[b]t2m-file:[/b] An earlier post mentions that the t2m-file holds an array of single precision floats of 64 bits. I suspect this is a typo as a single always only takes up 4 bytes or 32 bit, while a double type takes up 8 bytes or 64 bits. Anyway, for my particular t2m-file it was an array of 4-byte floats.
Let me know if I’m holding the wrong end of the stick here 😉 , but it seems to be working fine for the data files I have access to.
[i][b]Warning for Java-devs:[/b] The MSI-files are typically written according to little-endian byte ordering. Java uses the network byte ordering scheme (big-endian) (also used in the TCP/IP-protocol) by default. This means that you need to convert your bytes before interpreting them as a numeric value.[/i]