ome / bioformats

Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the Open Microscopy Environment. Bio-Formats is released under the GNU General Public License (GPL); commercial licenses are available from Glencoe Software.
https://www.openmicroscopy.org/bio-formats
GNU General Public License v2.0
379 stars 241 forks source link

ND2: Skewed image display #3661

Open dgault opened 3 years ago

dgault commented 3 years ago

Image was raised on imagesc thread https://forum.image.sc/t/bfconvert-nd2-rgb-to-stack-of-tiff-grays-channels/48360/7 A sample file reproducing the issue with Bio-Formats 6.6.0 can be found at https://github.com/bioimage-analysis/Files/blob/bd6977bbfb5081ba74d6202b3faf5b92ae1529f2/error.nd2

Opening the file with Elements Viewer suggests that the basic metadata (dimensions, pixel type etc) are correct. In Elements Viewer the image displays as:

107138018-88a10780-68c6-11eb-8ac8-fb465d10e7d9

With Bio-Formats the image is displaying as:

107138061-e59cbd80-68c6-11eb-8d74-aa5ccd16658c
imagesc-bot commented 3 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/bfconvert-nd2-rgb-to-stack-of-tiff-grays-channels/48360/9

loicsauteur commented 3 years ago

Hi @dgault

I wanted to mention that I have observed the same issue. A few RGB images saved as .nd2 would produce that, when opened with Bio-Formats (via Fiji). Sometimes, during the same imaging session, using the same acquisition/saving procedure, only a fraction of the nd2 files would give this skewed images (I could not identify a pattern). Re-opening them in NIS and saving them as tif or ome.tif solves this problem, as mentioned in the forum thread above.

FYI:

Could you find already a solution?

I have more example nd2 files if needed and can provide you a download link.

Thanks and bests.

dgault commented 3 years ago

Hi @loicsauteur, thank you for the additional details, unfortunately we do not yet have a solution for this particular bug. If you have any sample files showing the issue it would always be helpful.

loicsauteur commented 3 years ago

Please find 9 nd2 files with following link (will expire): https://filesender.switch.ch/filesender2/?s=download&token=d658ddd7-027a-44f8-8a85-29bc328d0101 8 of them are opening showing problems, one of them is opening normally. The biggest one might be a different problem... probably the only time I have seen that...

dgault commented 3 years ago

Thanks @loicsauteur for the sample images, they are a great help. With the latest Bio-Formats (6.6.1) I am seeing the skewing issue pretty clearly in 6 of them, however HistologzNikonMPVIVO_M2S2-75-25_HE_R2.3.nd2 and HistologzNikonMPVIVO_M1S2-25-75_HE_3.nd2 appear to open correctly. Are you seeing the same issue with those 2 files or is it a different problem?

loicsauteur commented 3 years ago

Yes, 6 of them have the described skewing error.

HistologzNikonMPVIVO_M2S2-75-25_HE_R2.3.nd2 is one that opens correctly. It is from a same acquisition session as some of the other images. May serve you as control...

HistologzNikonMPVIVO_M1S2-25-75_HE_3.nd2 opens almost correctly. The bottom part is screwed up... (see FIJI vs. NIS comparison below). Probably a different problem and maybe rather related to its size (and number of pixels, coming close to Java's limitation?). This problem is very rare, I observed it maybe 2-3 times. But I thought it may also be related...

Screenshot 2021-08-17 at 16 06 15

(Edit) If it helps: with the Bio-Formats 6.7.0 release, one more image is opening correctly: HistologzNikonMPVIVO_M2S6-25-75_HE_R2.2

dgault commented 2 years ago

An additional report of this issue has been received on forum thread: https://forum.image.sc/t/problem-with-nd2-large-image-stitch-opening-strange-with-bioformats-on-fiji/67319/5

A sample image showing the skewed image was provided and the error could be reproduced using Bio-Formats 6.9.1. In this case the image originally came from NIS Elements v4.3.

imagesc-bot commented 2 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/problem-with-nd2-large-image-stitch-opening-strange-with-bioformats-on-fiji/67319/6

imagesc-bot commented 8 months ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/problem-with-nd2-large-image-stitch-opening-strange-with-bioformats-on-fiji/67319/9

dgault commented 2 months ago

An additional report of this issue with 5 sample files showing the same skewed displayed can be found at /uod/idr/scratch/panama_nd2

4 of the files show the same issue and can be reproduced with Bio-Formats 7.3.1. The last file ending DIC_04T.nd2 appears to be correct. Changing the nd2 options for chunkmapping does not have any impact on the result.