From Granulomas to graphs - How this undergraduate is bad at histology but good at titles and 5 questions he needs help with


I’m currently in the process of messing around with QuPath, trying to quantify pulmonary granulomas in a less painful and more objective way than manually counting them, as everyone seems to do in my lab.

So far I’ve been tweaking cell detection settings and analysis’ to better classify cells automatically. In the very specific granuloma model i’m using I’ve almost got it down so that 90-95% of detections are cells belonging to the aforementioned granulomas.

I have a few questions though, I appreciate any help with answering them and apologise in advance if they’ve been asked before. I couldn’t really find much information anywhere which is surprising given how good QuPath is.

  1. Is there a way to exclude cells from being detected as a class if they are not adjacent to a certain number of cells of the same characteristic?

  2. Is there a way to export object classifiers? I don’t believe there is, although I’m fairly sure I can use a training image for this, although I haven’t actually tried or read too much about this yet. I’m also quite fond of having a classifier i could use across multiple projects involving similar samples.

  3. Would there be a way to standardise staining vectors between samples? I found two sets in a series of slides that I had misplaced and I’m intending to stain them, I’m considering trying to standardise them based off of a mean stain intensity between both batches of slides, would this work?

  4. All of my slides contain heart tissue and some of them contain intensely stained, folded regions. Is there a way for me to exclude high stain intensities from classification by the object classifier?

  5. I’m currently using the normal object classifier labelled as “train object classifier”. I’m quite interested in the pixel classifier but outside of a single youtube video and a descriptive paragraph, I’m not sure how to use it. Does anyone know of a resource on it?

Thanks again for your help, and thanks to everyone who helped to develop this software. :heart:

Cheers! :slight_smile: It depends a bit if you’re using the latest stable version of the latest milestone, but I’ve consolidated the main sources here:

The ReadTheDocs will become the standard from now on. There are also > 400 QuPath-tagged posts here, so you might find something else relevant.

Not entirely straightforwardly, although if you use ‘smoothed’ features (as shown in some of the classification tutorials) then the classifier may well learn this anyway.

(The non-straightforward method would involve using delaunay triangulation, and possibly a lot of scripting - I haven’t attempted precisely this, or fully tamed the triangulation yet.)

Assuming you’re using v0.2.0-m9 (or later…), see

You can save and reload the classifier if you have a project; in that case, you can find the file inside the ‘classifiers’ sub-folder of the project and then copy these to another project if necessary.

I’m not sure what you mean by ‘standardize’ here, but typically I’d run a script that sets the stain vectors across a project at an early stage (and use the same vectors for all images in a project). You might find some useful info in the supplementary material to

Your classifier could learn to exclude these (e.g. put them into an ‘Artifact’ or ‘Ignore*’ class) or ‘subtract’ the regions from your annotation before running cell detection (e.g. using the Brush tool with the Alt key pressed).

I haven’t written one - it’s still a work in progress, I prioritise working on it more than documenting it for now (not least because it will change some more).

Thanks :smiley: That’ll be me, and now also @melvingelbard!