32-bit float ND2s are assumed to be integer by Bio-Formats

Hi Bio-Formats team,

We have users using NIS-Elements to deconvolve their images. Part of this process is that their files are converted to float and so they are resultant files are 32-bit float point ND2s. I started getting reports than when these images were opened in FIJI they “looked weird”. So I had a look at the min/max values in NIS and FIJI and the results are below.

@petebankhead nicely looked into the code a little for me and here is an excerpt of what he said to me

It looks like it’s using the native reader & this line ensures that it isn’t floating point
https://github.com/ome/bioformats/blob/1bab228ef280985d4df4090ea5d634e3c3083d57/components/formats-gpl/src/loci/formats/in/NativeND2Reader.java#L837
As you can see by cross-referencing the method:
https://github.com/ome/bioformats/blob/a476f00af1b9b0e41cf8d62944c1e1c2a318f613/components/formats-api/src/loci/formats/FormatTools.java#L938
The legacy ND2 reader makes the opposite choice, passing fp as true:
https://github.com/ome/bioformats/blob/1bab228ef280985d4df4090ea5d634e3c3083d57/components/formats-gpl/src/loci/formats/in/LegacyND2Reader.java#L160
But unfortunately doesn’t seem capable of opening your image for some other reason (I checked it directly and got an error).

I didn’t get any deeper into it than this, but it looks to me that the code is written so that it assumes 32-bit is always int and never float with the native reader.

I was hoping maybe this could be maybe a not so big change for you guys to fix?

I found it slightly concerning that the files open seemingly fine and it’s not necessarily initially obvious that the values aren’t as expected.

Hi @lmurphy, this looks to be the first time we’ve encountered this variation of an ND2 file. Would you be able to upload a sample file for testing to https://www.openmicroscopy.org/qa2/qa/upload/?

Oh yes, sorry, I started to do that yesterday but must have gotten distracted.

It’s uploaded.

Im afraid something seems to have gone wrong with the upload, I can see you have opened a new QA but there doesn’t seem to be a file attached to it, would you be able to retry?

Okay, done.

I did it twice, second time with a simpler name in case the funny characters in the filename were causing a problem.

Thanks, we have received the file now. I will update this thread once I have been able to test it further.

1 Like