How to find measurements in mm2 of total biopsy area minus multiple annotations within?


Hi all,
I wonder how I can find square millimeters measurements on biopsies with different annotations. This image is just to illustrate. Lets say I have 10 smaller and larger annotations within the whole biopsy, and I want to know what is the total area of the biopsy in square mm, and the added area of all the smaller annotations within, and finally the total biopsy area except from the smaller annotations within?

Hi @elisyn,

You should see the Area information in the annotations tab when selecting each annotation.
It will either be in micron or pixels (depending on whether QuPath knows the pixel size of your image).

It’s not clear to me whether you want an automated way to do this, in which case we can provide a script to do this. However, we might need information regarding your annotations and a way to distinguish them?

1 Like

Hi @elisyn. I am doing exactly that kind of analysis and the area of the annotation is shown on QuPath on your lower right (annotations tab) as pix^2. If you know the pixel to um/mm you can just convert units and you will have the area in mm^2 (or um^2) per annotation. Hope this helps.

1 Like

There are quite a few options here depending on how you want to go about it. You may want to export all of your annotation areas with Measurement->Export measurements and handle it all externally to QuPath.

If you want to find the combined area of several annotation of one specific class, you could select all annotations of that class and then merge them. That does require having classifications to distinguish the annotations.
The scripted versions of those commands would then show up in your workflow.

You could do that for both classes of annotation to get two combined annotations. Then, you could either subtract those values in the output excel file, or, potentially, duplicate the annotations within QuPath and subtract them to form a third annotation. That would get a little bit more messy with the code since you would need to make sure to select annotations in the correct order.

And as several people have mentioned, default units are in microns or pixels, but that is dependent on your input, which you have not listed. If you wanted to, you could add a measurement that divides the microns squared (if you have them) by 10^6 and save that as “Area mm^2,” but more information is needed to make that work.

1 Like