QuPath H-DAB Project
  • ๐Ÿ“ŠQuPath guide for H-DAB Cell Counting Docs
  • ๐Ÿ’กPipeline
    • ๐Ÿ’กSimple Pipeline
  • Fundamentals
    • ๐Ÿ› ๏ธGetting Set Up
  • QuPath H-Dab Docs
    • ๐Ÿ’กQuPath H-DAB Tutorial
      • Creating and Opening of Projects
      • Estimating Stain Vectors
      • Training Image Creation
      • Cell Detection
      • Object Classifier
      • Tissue Detection
        • 1๏ธโƒฃAutomatic General Tissue Detection
        • 2๏ธโƒฃManual Specific Tissue Detection
    • ๐ŸงพQuPath Script
      • Batch Processing
    • ๐Ÿ“‚Output
  • Result Analysis Docs
    • ๐Ÿ’กProcessing Package Tutorial
      • Addition Information for Python insiders
      • In-Depth Python usage
    • ๐Ÿ—„๏ธFinal Spreadsheet creation
    • ๐Ÿ†˜Out-of-memory error
  • non-expert docs
    • ๐Ÿ”ŽQuPath Installation
    • ๐Ÿ’ปGit Bash Installation
    • ๐Ÿ–ฅ๏ธPython Installation & Packages
    • Git Bash installation
Powered by GitBook
On this page
  1. QuPath H-Dab Docs
  2. QuPath H-DAB Tutorial

Cell Detection

QuPath has already a built in function for cell detection that you can use.

PreviousTraining Image CreationNextObject Classifier

Last updated 9 months ago

  1. Under Automate > Show script editor open your "EstimateStainVecotrs_TissueComponentx" Script and run it on the training image.

If your training image is pixelated, rerun the creating a training image step.

  1. For performing the cell detection draw a square in the newly created training image including all the regions.

  2. 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.

If you do not see any detection the overlay opacity might be too low or the viewer is off.

To change that click on the icons in the list (top middle)

Toggle showing all detections in the viewer

Toggle showing detection ROIs as filled shapes in the viewer

adjusting the overlay opacity

It might take a while to find the correct settings for your slides but as a first step decide whether you should choose Haematoxylin OD for the detection or Optical Density Sum.

Choose Haematoxylin OD if your nuclei are blue and the DAB staining is not masking the blue. Choose ODS if you have blue as well as brown nuclei.

Then adjust the different settings you can find some examples of parameters set in the table below.

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.

See below
Cartilage
Disc Tissue
Disc Tissue

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

Cell detection PlugIn without adjaustments
Cell detection after optimisation
Dont change all the parameters at the same time. In the image above only the threshold and the max. background intensity were changed.
Examples for parameters for the cell detection
In the subfolder scripts of your project, the newly created scripts for the cell detection can be found