QuPath Guide-TMA Heatmaps

So this one will be quick, and thanks to @fabiotavora for the TMA images.

Presenting TMA results in a relatively simple manner has always been a bit… interesting, at least in terms of making the data dense enough to be easily interpreted. I have written a quick script that creates detection objects the size of each TMA core, and gives them values:

  1. Percentage for each class
  2. If an annotation exists within the TMA core, use that area measurement to generate cells/mm^2 measurements for each class.

Those measurements are included by default in the script, but any others could be added in the same way that the previous ones are included. Just ask if you have any questions!

Steps to use:

  1. Dearray your TMA
  2. If desired, use Simple Tissue Detection to generate area measurements within each TMA core.
  3. Run some kind of positive cell detection, or a cell classifier, on all annotations.
  4. Run the TMA heatmap script for M5
    4b. There is also a 0.1.3 version that should work for 0.1.2 as well, though that one only includes percentage positive.
  5. WAIT A LITTLE WHILE. The script is not fast. Maybe Pete will have some ideas to speed it up, but for the moment, it takes a minute or two to complete a 70 core TMA.

Initial TMA.

Some Viridis heatmaps.
Cells are relatively sparse in this tissue, so a standard Measurement Map doesn’t show much at low magnification.

Using the heatmap script, it is much easier to see where the positive cores are.

Note, all use of the heatmap will depend on accurate cell segmentation! Summary data is only as good as your actual segmentation and thresholding :slight_smile:

Also, leaving the fill detections on can cause problems while the heatmap objects exist and overlap the cell detections:

So here is a quick script to remove them, at least in M5:

heatmap=getDetectionObjects().findAll{it.getPathClass() == getPathClass("Tile")}
removeObjects(heatmap, true)
print "Heatmap Removed"