Seeking Positive Cell Detection Method with Highest Precision

Hi QuPath Community,

I am attempting to use positive cell detection to count cytoplasmic neuronal inclusions with a DAB stain. My images, however, have various artefactual stainings which I am having trouble getting QuPath to differentiate between. My method has been to use the built-in positive cell detection program on the entire image (not just a smaller region of interest). I try to optimize parameters manually for a single image, then further optimizing the parameters for another image, and then for a third one, and then assessing overall precision on the entire image set. I have had issues with this method, as some of the images are particularly messy and have false positives while other images don’t pick up enough positive cells. My issues may be coming from not optimizing the right parameters. I have found that increasing sigma removes some artefacts from a single image, but it also removes some positive cells which can be detected again by decreasing the threshold or the minimum nucleus area. Then, false positives can be reduced by changing the intensity threshold value. When I try the parameters out on a different image, however, there may be many false negatives, in which case I reduce the sigma and increase the threshold/minimum nucleus area. Thus far, I have found that I can optimize the parameters for a single image such that all of the inclusions are counted, but those parameters do not work sufficiently for all of the other images. Is there a way that I could be doing this method better or is there a better method than this for counting cytoplasmic inclusions in images with many artefacts? Perhaps one that involves coding or classifying cells vs artefacts?

Unfortunately, it appears that I am not able to show sample images due to image.sc policy that new users cannot upload images to posts.

Thanks,
Jeremy

Could you host an image or sample image elsewhere (Google drive) and then share a link to that?

In some cases, though, due to staining or artifacts, images are not really suitable for automated analysis. Preparation prior to analysis is important! In other cases, there may be tricks you can play with adding extra color vectors, but those are going to be project and image dependent.

Right, thanks for your thoughts on this. Here is a link to some sample images: https://drive.google.com/drive/folders/1679ric0qCh1-nN3_OoH5-Ugr19o4zu__?usp=sharing.

I have attempted to find a series of parameters that would work for three images and then attempting to use those parameters for the rest of the image set, but I haven’t yet been able to get parameters to work for three images. The sigma parameter I have understood to increase the circularity threshold, thus only more circular, nucleus-shaped inclusions would be included. Is this correct? Is there a way to filter for circularity in positive cell detection?

Sigma is Gaussian blur, and I suppose that might make rounder objects easier to detect, but generally it smooths the nuclear detection channel around so that there aren’t holes in the nucleus, which can cause problems with detection. The tooltip for each variable in the function should help with that a bit.

You can’t filter for circular nuclei during detection, but you can filter for almost anything after you have created the cells. There is a ton of information on classifiers in the links within the first paragraph or so here, so you can set classes to be “too eccentric” or things like that. Then you could ignore or delete those. If the background haze of some of the smudges is causing problems due to the light hematoxylin staining, you might want to try playing around with the two background fields, radius and intensity. Unfortunately that doesn’t work too well, nor does anything else, on the JPGs :slight_smile:
After the fact, you might be able to use the Haralick features in Add Intensity Features to eliminate the regions that are just grey blur. They should have low variability (standard deviation may work as well).

If your DAB stain is cytoplasmic, you may want to use Subcellular detections, though those also won’t work in a JPG due to lack of pixel size information. More on that here. It can be used for much more than just spots, and I find it useful for oddly shaped structures, especially when the cell expansion dilutes any kind of “mean cytoplasmic” measurement.

There are some video playlists here.

I describe the cell detection parameters in detail in QuPath tutorial #2 - IHC analysis

Thank you! I will follow up on both of your suggestions!