Hi there,
before I despair I ask the RADIANCE-world (maybe there is a difference even if there shouldn't be one):
When writing out data with 'pvalue' you can write ascii or binary files.
I chose 'pvalue -o -h -df ' for a binary file
and 'pvalue -o -h ' for an ascii file.
I then read both files into Matlab (under MS Windows): The ascii files are fine, they show the exact same values as when viewing the corresponding pic-image with ximage, or when just looking at the ascii-file itself. (The world is consistent! Great!)
Then I read the binary file in (I have taken into account that the files were generated on a big-endian machine and are now read on a little-endian machine).
And: The numbers that you yield look reasonable, similar to what you would expect, BUT they are not the same, even though the binary and the ascii file were generated from the very same pic-file.
I looked at the minimum and the maximum values of either file, I computed the sum over all pixel values: they are just not the same! (just in case the matrix I deal with is in a different orientation)
WHY??? Please help!
Thanks!!!!!!!!!!!!!!!
Alexa
P.S. yes, I could use ascii-files, but they are huge and it takes longer to read them in. So, that's why I want to store them as binaries.
···
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dr. Alexa I. Ruppertsberg
Department of Optometry
University of Bradford
Bradford
BD7 1DP
UK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi Alexa,
The latest version of pvalue (from the HEAD distribution) includes a -dF option to output byte-swapped floating point problems. If your source and destination machines have different byte orderings (little endian vs. big endian), then this might solve your problem. You also should apply the -H option (in addition to the -h option) to avoid output of the image resolution string, which will likely mess up the reading of the data.
-Greg
···
From: "Alexa I. Ruppertsberg"
Date: February 20, 2004 5:25:52 AM PST
Hi there,
before I despair I ask the RADIANCE-world (maybe there is a difference even if there shouldn't be one):
When writing out data with 'pvalue' you can write ascii or binary files.
I chose 'pvalue -o -h -df ' for a binary file
and 'pvalue -o -h ' for an ascii file.
I then read both files into Matlab (under MS Windows): The ascii files are fine, they show the exact same values as when viewing the corresponding pic-image with ximage, or when just looking at the ascii-file itself. (The world is consistent! Great!)
Then I read the binary file in (I have taken into account that the files were generated on a big-endian machine and are now read on a little-endian machine).
And: The numbers that you yield look reasonable, similar to what you would expect, BUT they are not the same, even though the binary and the ascii file were generated from the very same pic-file.
I looked at the minimum and the maximum values of either file, I computed the sum over all pixel values: they are just not the same! (just in case the matrix I deal with is in a different orientation)
WHY??? Please help!
Thanks!!!!!!!!!!!!!!!
Alexa
P.S. yes, I could use ascii-files, but they are huge and it takes longer to read them in. So, that's why I want to store them as binaries.