Excluding tissue boundary on WSI

Hello! I was wondering what suggestions anyone could give about excluding the tissue boundary on a WSI? I’m analysing a large cohort H-DAB prostate needle biopsy images, and using Simple tissue detection to create an annotation for each tissue core. However, DAB staining is strongly positive at the edges of the tissue core and I’d ideally like to exclude this from the analysis. Apart from manually modifying each annotation, any ideas on how to automate it?

There is an expand annotations command in the annotations menu you can play with. Pick a value that works for your sample, then use something like:

selectAnnotations()
runPlugin('qupath.lib.plugins.objects.DilateAnnotationPlugin', '{"radiusMicrons": -50.0,  "lineCap": "Round",  "removeInterior": false,  "constrainToParent": true}');
selectObjects{it.getLevel() == 1}
clearSelectedObjects(true)

You may need to select a different getLevel or use another method of picking which annotations to remove depending on your project (TMA would likely be at Level 1 if you have a TMA grid).

Wonderful! Works perfectly. Many thanks