H-score by object class


I have gotten Qupath to detect cells, classify tumour and stroma region and bin IHC score by cell intensity.

Now, I am trying to write a script to generate data: prints filename, H-Score, number of Tumor cells that are :1+, 2+, 3+. This way I can run by project and batch generate results all the images.

I have attempted to modify this solution script by Olivier to no avail.

import qupath.lib.gui.models.ObservableMeasurementTableData
def ob = new ObservableMeasurementTableData();
def annotations = getAnnotationObjects()
// This line creates all the measurements
ob.setImageData(getCurrentImageData(), annotations);
annotations.each { annotation->println( ob.getNumericValue(annotation, “H-score”) )}

but all it shows is

INFO: Result: [Rectangle - 911 objects]

I know I need to change certain lines to select tissue class with something like this: selectObjects { p -> p.getPathClass() == getPathClass(“Tumor”) }

but my scripting abilites is limiting me… :frowning:

like to get some help here…


If you want batch results for annotations by project, Pete has tutorials.

1 Like

Thank you very much

These two tutorials worked nicely for me

1 Like