question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

considering down-converting float64 to float32 when saving?

See original GitHub issue

❓ Question

Should we consider making the builtin napari_write_image implementation default converting 64 bit float to 32 bit float? I wonder how many people are going to save a tiff from napari and run into an error when they try to open it in Fiji…

Of course, we need to somehow open up control to users… but just wanted to flag that potential near-term issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ctruedencommented, May 1, 2020

The problem is that ImageJ1 does not support 64-bit floating point images. Only ImageJ2/ImgLib2 supports that. Bio-Formats can open them but it must ultimately downcast it to 32-bit (because the Bio-Formats Importer is still built on ImageJ1). If you use File > Import > Image… to invoke SCIFIO, you should get a true 64-bit floating point image. But displaying it in the legacy ImageJ UI (the default Fiji uses), it’ll still say “32-bit” in the title bar because it has to lazily downcast it to 32-bit to make ImageJ1 happy.

The good news is that if you use PyImageJ and write e.g. img = ij.io().open(my64bitTIFFfile) you should get back a 64-bit Dataset object, which can be turned into a numpy (soon to be xarray) object using ij.py.from_java(img). Let me know if that doesn’t work!

Sorry the situation is so complicated, guys. 😦

0reactions
tlambert03commented, Apr 30, 2020

a ha, yes indeed! see i was doing something wrong! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Go: Why does converting from a float64 to a float32 and ...
float32 has less precision than float64 . Neither type can exactly represent the real number -3942.2, but float64 gets closer.
Read more >
Consequence of using single (float32) or double (float64) ...
When saving interpolated data (after linear or non-linear warps but also as well as internal representation) we often face the decision if single...
Read more >
Float32, Float64 | ClickHouse Docs
Float64 — DOUBLE . When creating tables, numeric parameters for floating point numbers can be set (e.g. FLOAT(12) , FLOAT(15, 22) ...
Read more >
Issue with PointType update from Float32 to Float64 - PI Square
We have changed pointtype from Float32 to Float64 as it support accuracy till 15 digits. The changes are saved in PI Data archive...
Read more >
How to convert Int data type to Float in Golang?
Explanation: Firstly we declare a variable x of type int64 with a value of 5. Then we wrap x with float64(), which converts...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found