I do agree with @VetPathologist that an annotation expansion might be easiest if the periTumor area is otherwise less well defined, but for the moment I will go off of the assumption that you are manually annotating it. Another thread on expansion/erosion can be found here.
Don’t mind the lack of tumor in the example!
The easiest way to go about things, still, is to have classes for everything as you manually annotate it. So create your full tissue annotation, classify it as stroma (though that itself is easily scriptable). Draw your annotations for tumor and peri-tumor regions, and classify those as well.
When adding points for your nerves, make sure you change class as shown in the image. Each time you click the “Add” button you can start a new group of points, which can have an individual class. Highlighting a Points object in the list (and having the points tool selected!) will let you continue adding points of that class. Points are collections of objects, so doing it this way makes the next steps much easier.
Although… oops. I just realized, I am not sure if you want point density, or counts per area. Counts per area would involve the difficulties I was trying to avoid, while density (neurons per um^2, tumor, stroma etc.) across all regions of a type should be fairly easy. Could you clarify?
Here is the quick density script though. Note that it assumes certain things, listed in the script, and currently doesn’t clear previous results.
Results should be listed as shown. Red shows difference in annotation area to calculated area, blue shows the measurements showing up in a new “Results” whole image annotation. These results should be for all tumor/peritumor/stroma regions in total.
I can work on a different version later, but it would take a little more time to split the points annotations and figure out where they all go.