Bfconvert - nd2 RGB to stack of TIFF grays channels

Hi all,

I am trying to do a simple conversion of RGB .nd2 files into RGB TIFF files using bfconvert. Everything work well except that it create a stack file with the R, G and B separated. Is there a simple way in bfconvert to create an RGB TIFF file?


I just came up with a somewhat related problem, RGB .nd2 files are read differently in ImageJ and NIS-Elements, the R and B are reversed between imageJ and Elements.

Hi @bioimage-analysis, can you post the output of the below command on the converted file:
showinf -nopix path/to/convertedFile.tiff

It may be that you need to convert to separate channels first and then merge them using a pattern file (Grouping files using a pattern file — Bio-Formats 6.6.0 documentation)

Hi , thanks for your answer, I did found a work around that issue, it seems that Elements was doing an BGR instead of a RGB, I flipped the 2 channels using ImageMagik after conversion.
Now I came to another issue, the RGB images are distorted after conversion (image coming from the Nikon DS-Ri2), which doesn’t happen with B/W images from the Nikon DS-Qi2 sensor on the same microscope, here how it looks like:

I feel like I have seen that error before.
Any help is welcome.

I don’t think it is the cause, but it is probably worth checking first if disabling the chunkmap has any impact, from bfconvert this can be done with the option:
bfconvert -option nativend2.chunkmap false input.nd2 converted.ome.tiff

When you compare the metadata of the converted file do the dimensions look correct? It looks like the X dimension is perhaps wrong in this case

I found out, it’s a very strange error, it only happen for stitched image that are between 7.2x7.2mm and 8.1x8.1mm (for the 4X Obj). Not sure if there is some strange thing that happen with the metadata?
Note that it only happen with RGB images and if I actually only save one of the RGB channels independently the conversion works well. I did try to bfconvert the channel independently but that didn’t work.

That does seem very odd, would it be possible to share the original nd2 image to a public location so I can further investigate the issue? If you need an upload location we would recommend using Zenodo.

Hi David, thank you for getting back, it’s the same error than here:

I also opened an issue in nd2reader:

Here is a link to a crop version of the file:

Note that my solution is to use the nd2sdk nd2 to ome.tiff converter from Nikon, unfortunately it only work for Window, but it works very well.

Thanks @bioimage-analysis, I have also opened a Bio-Formats Issue for this bug: ND2: Skewed image display · Issue #3661 · ome/bioformats · GitHub