Login  Register

Re: How to store double values

Posted by seb-7 on Mar 15, 2007; 9:48am
URL: http://imagej.273.s1.nabble.com/How-to-store-double-values-tp3700031p3700039.html

erwan bocher wrote:

> Hi list,
>
> I use ImageJ to read a text image and store it into a tiff file.
>
> For example, I have this matrix :
>
> 1 1.123456789 2.123456789
> 2 2 2
> 11 3.12345678
>
> When I save my text image in TIFF, ImageJ trim the decimal values. (Note I
> have modified the precision to 10 in the IJ_Prefs.txt file ).
> My new values :
>
> 1.000000000    1.123456836    2.123456716
> 2.000000000    2.000000000    2.000000000
> 1.000000000    1.000000000    3.123456716
>
> Have you got any idea ?

Hi Erwan,
I don't know how to solve your problem, but here is an explanation:
I think you want 64-bit (double) floating values, but here you have only
32-bit floats (simple).
Using simple floats you therefore have about 6 "exact" digits, instead
of 15 digits with 64-bit floats.
I don't think we have 64-bit TIFF_DOUBLE in ImageJ, but I think you can
use 64-bit Raw files and the FITS_Reader also supports the
"GRAY64_FLOAT" type.
http://fits.gsfc.nasa.gov/fits_intro.html#Description
So maybe you need to use fits instead of tiff for your high-accuracy
matrix storage.
Regards,
sebastien