Cell Detection
QuPath has already a built in function for cell detection that you can use.
Last updated
QuPath has already a built in function for cell detection that you can use.
Last updated
Under Automate > Show script editor open your "EstimateStainVecotrs_TissueComponentx" Script and run it on the training image.
For performing the cell detection draw a square in the newly created training image including all the regions.
Under Analyze you can find cell detection or you can use the shortcut ctrl+L and then type in cell detection to open the window.
Run the cell detection PlugIn not the positive cell detection.
Those parameters are suggestions we used on our stainings, you must adjust them for your own project, but they might help as a starting point.
1
ODS
ODS
HOD
2
1
1
1
3
5
8
8
4
0.5
0
0
5
0.8
1.5
1.5
6
5-100
20-100
10-400
7
0.12
0.2
0.1
8
1.5
0.25
2
Adjustable parameters are:
Even when the cell detection is optimised non-cell regions will get recognised as cells this is due to the tissue properties. In the next step, we will train the system to recognise those as non-cell regions.
Under Workflow > create script save a new script "CellDetection_componentx". This script will be needed to run the cell detection on other training slides and to substitute the cell detection in the final script.
Delete all the previous lines except the last one starting with runPlugin('quPath...)
Then click on File > save as > File name: Cell Detection, Save as type: Groovy file
runPlugin('qupath.imagej.detect.cells.WatershedCellDetection', '{"detectionImageBrightfield":"Optical density sum","requestedPixelSizeMicrons":1.0,"backgroundRadiusMicrons":8.0,"backgroundByReconstruction":true,"medianRadiusMicrons":0.0,"sigmaMicrons":1.5,"minAreaMicrons":20.0,"maxAreaMicrons":400.0,"threshold":0.2,"maxBackground":0.25,"watershedPostProcess":true,"excludeDAB":false,"cellExpansionMicrons":5.0,"includeNuclei":true,"smoothBoundaries":true,"makeMeasurements":true}')
1 Detection images
Haematoxylin OD,
if the nuclei are blue, if they are brown the
DAB might mask haematoxylin and they do not get recognised.
Optical density sum (ODS),
if you have a lot of brown and blue nuclei
2 Requested pixel size
Check pixel size in Image und Image
The bigger the chosen value in pixel size the faster, find the max. size that is still accurate
3 Background radius
QuPath will try to subtract background value from each pixel
Correlates with Threshold
Should be greater than the largest nuclei or set to 0 if it is turned off, then threshold needs to be increased
4 Median filter radius
If Nuclei are segmented increase
Way to smooth image
5 Sigma
Segments nuclei but could also merge them together
Way to smooth image
6 Area
Minimum area/size of a nuclei
Maximum area/size of a nuclei
7 Threshold
Can help to remove detection of false nuclei within tissue
If a high amount of cells is not detected try lowering the threshold.
8 Max background intensity
Can remove tissue fold as background is darker as usual
The lower the value the more the folds will be ignored
Default doesnโt really show an effect