Positive cell detection with lots of wrong signals in the background

840 views
Skip to first unread message

forster...@gmail.com

unread,
May 23, 2018, 4:59:19 PM5/23/18
to QuPath users
Dear Pete, dear QuPath community,

Right at the moment, we are working with positive cell detection for macrophages in IHC. We have a big problem with strong and false signals in the background and over detection of cells (too many cells are counted/one nucleus is separated into several cells). Is there any way to overcome the false signals and the over-detection by changing specific parameters? Several images are attached, highlighting our struggles.

Thanks for your help,
Stefan 


Bildschirmfoto 2018-05-23 um 22.47.32.png
Bildschirmfoto 2018-05-23 um 22.50.13.png
Bildschirmfoto 2018-05-23 um 22.50.21.png

micros...@gmail.com

unread,
May 23, 2018, 8:18:16 PM5/23/18
to QuPath users
First impressions would be that you probably want to use Nuclear DAB not whole cell DAB for your positivity, since your cell expansion usually does not contain anything important and is diluting your Mean Cell DAB by it's area.  Also, most of the false positives look like they might be due to small amounts of DAB scattered around, so you might be able to use Subcellular Detection of DAB rather than a DAB mean (or median) to determine positivity.  Macrophages are difficult due to the Hematoxylin nucleus being a "maybe."

To try: 
1. In Cell Detection use 0 Cell expansion, then use Analyze/Calculate Features/Add Intensity Features - Median for the DAB channel, threshold off of that value

2. Use DAB as your primary channel for cell detection (swap color vectors with hematoxylin, use the Hematoxylin only cell detection), and do two runs per slide, one to detect positive cells, one to detect negative cells.

3. Perform cell detection as is, but ignore positive and negative results.  Perform Subcellular detection on a higher threshold of DAB OD, and with a high enough minimum area to avoid the smaller spots that you do not want.



forster...@gmail.com

unread,
May 24, 2018, 2:13:30 AM5/24/18
to QuPath users
Thank you very much for your help! I will try and keep you updated about my struggles.

Best wishes,
Stefan

Pete

unread,
May 25, 2018, 4:06:50 AM5/25/18
to QuPath users
Hi, here are a few more thoughts/tips related to parameters that might help with the detection:
  • If one nucleus is being wrongly subdivided into multiple nuclei, try increasing either the median filter or the sigma.  Both smooth the image, but in slightly different way (the median filter removes outliers a bit more cleanly, while the sigma refers to a Gaussian filter that tends to be a bit less artefact-y)
  • If too many nuclei are being detected, try increasing the Threshold value and/or the Minimum area
  • If you have very large/clustered nuclei, you might need to increase the Maximum area and you could also try increasing the background radius - or set it to 0 to avoid trying to subtract background at all
You also might see some small improvement if you estimate the stain vectors - see https://github.com/qupath/qupath/wiki/Preprocessing - and you can check how the separated stains look, e.g. with https://github.com/qupath/qupath/wiki/Changing-colors

Doing that, you can compare the hematoxylin and DAB images.  If you can see all the nuclei clearly in the hematoxylin image, then I'd try setting the detection image (top parameter in cell detection, drop-down box) to be Hematoxylin OD; otherwise Optical density sum can help because it will just use all staining - regardless of color.  It's worth trying both anyway.

Finally, in your case I think you might want to decrease sigma and increase the median radius - in addition to adjusting the threshold.  It looks like lots of small 'brown things' are being detected as nuclei - but with large white spaces outside, which suggests they have been blurred out a lot before detection (which is where the sigma comes in).

If you find that is unavoidable, there is the option to remove cells based on specific measurements - or combinations of measurements - in a script.  For example, I would guess that these objects have low values for both hematoxylin and for DAB.  Here's a script that would remove cells with low values of both:

detections = getDetectionObjects()
print 'Number of detections before: ' + detections.size()
lowDAB
= detections.findAll {return measurement(it, 'Nucleus: Hematoxylin OD mean') < 0.1 && measurement(it, 'Nucleus: DAB OD mean') < 0.1}
removeObjects
(lowDAB, false)
detections
= getDetectionObjects()
print 'Number of detections after: ' + detections.size()

Of course the cutoff values I've chosen here (0.1 in both cases) could be very wrong... it could require some use of File -> Save before and File -> Revert afterwards to play around with alternative values.

micros...@gmail.com

unread,
May 25, 2018, 2:33:08 PM5/25/18
to QuPath users
Just for fun, rather than removeObjects you could use selectObjects first, so that you could see what you would be getting rid of with various thresholds.  Or alternatively you could set their classification to something.


selectObjects {return measurement(it, 'Nucleus: Hematoxylin OD mean') < 0.1 && measurement(it, 'Nucleus: DAB OD mean') < 0.2 && it.isDetection()}

Note that this will also select ALL subcellular detections (and probably tiles/SLICs), since they are both detections and do not have measurements like "Nucleus:..."  I haven't looked around to see if there is an it.isCell(), though I might be able to use some sort of "is not a subcellular object."

forster...@gmail.com

unread,
May 25, 2018, 2:57:43 PM5/25/18
to QuPath users
Thanks Pete,

that's a lot of great input, I will try each of your tips, hoping to find a solution but I am quite optimistic now. Thanks for the great support!

Best wishes,
Stefan  
Reply all
Reply to author
Forward
0 new messages