QuPath - multiplexed analysis

Hi all!

I’m working with double stained images (DAB on nucleus and RED in a membrane protein) and I’m trying to do a multiplexed analysis with a machine learning protocol (https://qupath.readthedocs.io/en/latest/docs/tutorials/multiplex_analysis.html), but I’m stuck in this part when it comes the message “you need to annotate objects with at least two classifications to train a classifier”.

I really appreciate if someone knows how to help me :slight_smile:


Sample image and/or code

Hi @biancatroncarelli,

QuPath shows you this message because it needs to know examples of at least two classes in order to classify all your objects as belonging to either class.

For instance, let’s say that after detecting your cells, you want to classify them into tumor and stroma. To do this, you need to annotate some cells as tumor, and some other cells as stroma. QuPath will then calculate features based on these labelled cells and figure out some classification logic (based on the type of classifier like random trees in your example). Pressing Live update will tell QuPath to apply this logic to all objects in your image and show the resulting classifications to you.

If you don’t give it at least one example of two different classes, it won’t be able to do this and will throw an error. You can check out this page in the docs with more info about this.

Good luck!

1 Like

Hi @melvingelbard!

Thank you so much for your help!
It worked!!!

Just one another question, after applying the filter, can we have the measurement of cell per square millimeter (mm²)?

Thank you so much again!

If you are classifying cells within a ROI, you can go to “Measure” -> “Show annotation measurements” you will find number of cells as well as area of the annotation. From there on it should be straight forward to calculate cell density for all cells or per class.


As this thread suggests and @Ajay_Zalavadia mentions, not automatically, and it might be better to calculate these things outside of QuPath. If you create any of the measurements, they will be static. That means if you rerun your cell detection, or change your classifier, the measurements will not change until you rerun the script.
That said, there are options here: M9 Multiplex Classifier Script Updates (cell summary measurements/visualization)
That script is a bit complicated, so make sure you read and understand everything it can do (especially if you want to run it for a whole project). It is complex enough to be able to handle multiplex analysis.

1 Like

Thank you so much all!