Sample image and/or code
I have a whole slide image (WSI) that I have exported tiles from and produced a probability from each of them using an external deep learning model. It would be great to visualise the probabilities using a heatmap, something like the following, perhaps:
Here, the region shown was split into three overlapping tiles, and I have coloured the central part of each tile with a colour on a red-to-green scale. (Only colouring the central parts to avoid having to figure out what to do with overlapping tiles!) For whatever reason, there was no tile in the bottom right corner, so that stays untouched.
One way I could do this would be to export the whole image, either as a single PNG or as tiles and then overlay a heatmap on top of it using something like OpenCV or Scikit-Image. That has the big downside of losing all of the benefits of working in QuPath (such as being able to zoom in to the image and pan around it), as well as having to create a potentially-large PNG file.
Another way might be to create the overlay as a separate image and then get QuPath to do the overlaying, such as in Pete’s gist. But if I understand this correctly, I would need to create a PNG or TIFF image with the same size as the original WSI, which is huge!
A third way might be to create each of the square patches as an annotation, and to have a handful of classes corresponding to different probability ranges. That could then be viewed quite easily, though it would interfere with existing annotations.
Does anyone have any better suggestions? I surely can’t be the first person who’s wanted to integrate externally-generated heatmaps with existing images!