I am working with a TMA and have applied a detection classifier and an intensity threshold for “positivity”. Now I’m trying to restrict my analysis of the stromal cells on the areas within a certain radius r (e.g. 0.2 mm) around the tumor cells classified as such by the detection classifier.
I have read the procedure by Pete here, however this doesn’t seem to be practically applicable in TMAs with multiple annotations.
So I thought even though it might not be the most efficient way, creating a measurement about the neighborhood to tumor cells might be the easiest way to solve this.
I thought about looping through all the detections, creating an annotation (circle with radius r) around the centroid of each detection, then through the hierarchy determine if there are more than n tumor cells (e.g. n=4 in order to smooth as there might be single wrongly-allocated cells by the detection classifier), and creating a measurement for the detection indicating whether it is surrounded by at least n tumor cells within the radius r. (Then remove the annotation and cells with a “negative” measurement of the tumor-environment.
As I’m just new to coding I couldn’t yet manage to get a proper script for that process - especially the part of determining if there are more than n tumor cells within the created annotation.
I’d highly appreciate your ideas of whether this might work and how I could implement that into a script.
Thank you very much.
PS: I’m using v0.1.2 as I started my project here.