I’ve asked related questions about this before but as I’ve continued to poke at it in spare time have hit a bit of a wall.
prior conversations for ref:
I have large (~30x50k x 8 channel) image data, (the result of aligning whole scanned slides in Matlab). I have been trying, without success, to get these saved in a format readable by QuPath.
Bioformats bfsave for matlab and attempting to use the bioformats writer class directly as suggested here: MATLAB example of writing tiled pyramidal OME-TIFF using the Bio-Formats API · GitHub give a max size related error. (As does using the matlab tiff class directly) For calling the bioformats class directly from matlab the specific error is : Error using loci.formats.out.PyramidOMETiffWriter/saveBytes
MATLAB array exceeds an internal Java limit.
I can save the image to a set of tiled standard tiffs one per channel using blocproc or bigimage in matlab.With bigimage I can save either a single or a pyramidal version according to whatever the mysterious matlab pyramid convention is. Though this is not my goal, but for reference, none of these single channel images will consistently open in QuPath. Usually at least, they all fail without any error message on an attempt to add them to the project.
I’ve also tried pyramidalizing and concatenating these individual channels with bfconvert and a pattern file on the command line. E.g.
echo “bigimagesavedtiff_channel_nopyramid_<1-8>.tiff” > image.pattern
bfconvert -tilex 512 -tiley 512 -pyramid-resolutions 4 -pyramid-scale 2 -noflat images.pattern image.ome.tiff
The tiffs generated by matlab blocproc converted (after a very long wait) but were not recognized by QuPath as a pyramid, nor as multichannel. QuPath loaded the lower resolution levels as separate single channel images and failed to load the larger levels into the project (giving an error message that x images were not added).
To be fair I have no good reason to think the concatenated images would be recognized as channels beyond I read it on the internet, but I would think the pyramid would work.
Converting (with the same command) the images generated from matlab by bigimage gives a different failure. These load as an apparent single image in QuPath, however I’m only actually seeing one of the 8 channels at (I suspect) some middle resolution (definitely the high resolution is not there).
If I pyramidalize each channel separately with bfconvert and don’t try to concatenate them they will load properly in QuPath individually. So I could probably then concatenate them with a QuPath script, but its such an awkward workflow I’ve been reluctant to accept it, this is something I’ll want to set up for other people to do regularly. I’d love of course to have it all in matlab.
I know of course this is probably some subtle meta data or formatting thing (in fact none of these images have any meta data at all beyond what bigimage or bfconvert puts it in). However, I’ve now tried just about anything I can think of/google and hit different dead ends each time. I can’t even seem to quite find the detailed spec of what makes a valid bioformats pyramidal tiff to try to comply with it.
This is slightly exotic, but not -that- exotic. Has anyone actually built (big) images from scratch for QuPath with or without bioformats, especially from matlab, that could weigh in on where I’m going wrong?