Bfconvert not always creating ome-tiff, sometimes just plain tiff

Hello,

I have been recently using bfconvert to convert some of our whole slide images to ome-tiff format for use in QuPath. For the first set of images I have been converting it has worked very well (all greater than 2 gb, native tiff). For a second set (same format, smaller than 2 gb), after conversion that output doesn’t appear to be a true ome-tiff. I first noticed while trying to extract xml using tiffcomment, but can also see this using showinf. I am using bfconvert 6.5.1. I have pasted showinf data below on both input and output images for the image that doesn’t appear to convert to ome-tiff as well as the one that does. I feel like I must be missing some pre-requisite in the one case but not the other, but am not sure what that might be.

I am calling bftools as:

bfconvert -noflat -bigtiff -pyramid-resolutions 4 -pyramid-scale 2 input.tif output.tif

Any help would be greatly appreciated.

Thanks!

Alex Corwin

Image that is not converting to ome-tiff but instead just as tiff:


Image after conversion (file format shows as TIFF):

Image that is converting properly to ome-tiff:


Image after conversion (file format shows as OME-TIFF)

Hi @adcorwin, I don’t know why bfconvert behaves oddly but you might want to try the Glencoe tools (Converting Whole Slide Images to OME-TIFF: A New Workflow) which are quite a bit faster in doing the conversion you need.
Cheers,
Damir

The output file path should finish with ome.tiff. Try:

bfconvert -noflat -bigtiff -pyramid-resolutions 4 -pyramid-scale 2 input.tif output.ome.tiff

3 Likes

Hello,

Thanks for the suggestion. I was unclear in my specification of the command line I was running as I had labeled my generic output file as output.tif. I have actually been specifying an output file as output.ome.tif (which I believe according to the docs should trigger conversion to ome-tiff as would the ome.tiff extension).

Thanks,

alex

Hi Damir,

Thanks for the suggestion. I will see if I can get this running for my environment (windows 10). I see an earlier forum post (Bioformats2raw on Windows os) and will follow those suggestions.

thanks,

alex

In my experience you need two fs in tiff for it to trigger. Let us know.

Hi Damir,

Following your suggestion I have been trying out the nice Glencoe tools for doing this. I have run into an issue with the bioformats2raw conversion for my images (see screenshot below for error message). I tried running it on one of the ome images I was able to create (see original post), and it did generate a directory of tiles, which I could then convert back to ome via raw2ometiff (after turning off compression as I don’t have the blosc library built and installed yet).

Looking at the error message that was generated (“Error while calling command (com.glencoesoftware.bioformats2raw.Converter@1bbf683): java.lang.IndexOutOfBoundsException: Index: 0, Size: 0”) I am not sure what to do next. Here is the image I was trying to convert to raw: dapi.tif (13.4 MB)

I have grabbed the tiff2raw python converter (https://github.com/glencoesoftware/tiff2raw) and will try that as well.

Thanks for all of the help,

alex

Hi Alex,

Indeed, I get the same error on linux and had a quick look at the file: it looks to be a tiff with a non-standard pyramid in it. That looks to be tripping up bioformats2raw. Maybe something @melissa is able to look at? But you can use the regular OME Bio-Formats bfconvert tool which appears to be more tolerant. Download from: https://downloads.openmicroscopy.org/bio-formats/6.5.1/artifacts/bftools.zip and see: https://docs.openmicroscopy.org/bio-formats/6.5.1/users/comlinetools/conversion.html for instructions how to run. It worked for me on your file. Just make sure to specify the output file with a .ome.tif extension.

Just for my info: what system generated these? Looks to be some kind of GE instrument?

Cheers,
Damir

One alternative option: you could use the tiffsplit tool from the standard libtiff toolkit (http://www.simplesystems.org/libtiff/) to split out your pyramided tiff. You can then discard the sub-resolution tiffs and just convert the “aaa” image using the Glencoe tools. That works as well.
D

Thanks Damir,

Yeah, the bfconvert tool works on these images, but for some larger images (same format) it seems not to produce ome-tiffs, but instead just regular tiffs (the original issue of my post :blush:). That said, I can always bootstrap this as the regular tiffs that are created with bfconvert can then be run through with bioformats2raw followed by raw2ome which will let me end up with ome-tiffs (though since I’ll still need bfconvert I won’t get the great speed benefits from the bioformats2raw and raw2ome tools).

This image comes off of an IN Cell microscope (previously GE, now Cytiva) being run with some custom software.

Thanks!

alex

Thanks :blush:

I was thinking the same thing and am literally looking at that page at this moment and looking for pre-built windows binaries of tiffsplit to save myself the trouble of having to build it :blush:

Thanks,

alex

You might also try using the --extra-readers option, which should result in the file being treated as a regular TIFF. The command would look something like:

bioformats2raw dapi.tif pyramid-output --extra-readers

The last paragraph of the “Usage” section in the bioformats2raw readme (https://github.com/glencoesoftware/bioformats2raw) gives more detail on how to use this option.

Thanks Melissa!

Using tiffsplit (a great suggestion from Damir) I can pull out the highest resolution level from my pyramid images and run them through both bioformats2raw and then raw2ometiff. My remaining question is a bit greedy, but since the speed of this current process (tiffsplit, bioformats2raw and raw2ometiff) is really very nice I was wondering if there are any good ways to combine multiple input tiffs so that I can end up with a multichannel ome-tiff as final output. I had been doing this using bfconvert with the .pattern file for channels, and while this should do the job (either using –extra-readers as you suggest or using tiffsplit to split out the highest resultion level from my original tiff) it is definitely a fair bit slower. It doesn’t look like either bioformats2raw or raw2ometiff are designed for merging files, so do you know if there are any other tools for doing this that can avoid the slower performance of bfconvert (this is the greedy part :blush: )?

Thanks,

alex

Hi Alex,

bioformats2raw can also take a .pattern file just like bfconvert. I use that extensively and it works well.

And thanks @melissa for the --extra-readers tip!! As far as I understand, that just stops bioformats2raw from trying to interpret that non-standard pyramid’ed TIFF by not trying to use the Glencoe/Faas legacy tiff reader.

Damir

1 Like