I have recently been doing work with cell detections and cell density maps in HE stained images. I was wondering if there was a way to create annotations based on a cell density threshold? similar to how the pixel threshold creates annotations of various size parameters for tissues.
I have played with some of the spatial analysis options in QuPath but they do not quite give me what i am looking for.
Two things I can sort of think of off the top of my head are the hotspot analysis and the cell density function, which could probably be used to create outlines as well with some modifications.
Hotspots: QuPath Spatial analysis - getting started - #2 by Mike_Nelson
Heatmap: Cell Density Map - #18 by EP.Zindy
One useful part about the heatmap is that it generates measurements within the detections that could be used for clustering, or you could use the FP to generate a mask (and then an annotation) from areas with above a certain density.
One other option was also rattling around in my head, this one from @petebankhead , but I am not sure which version of QuPath it was for:
It might be possible to use this script once you classify the cells based on your heatmap. In other words, make a threshold classifier based on whatever your are showing in your first image, and then those cells will be positive and all other cells will be negative. You should end up with two annotations, one for positive, one for negative.