How do I view measurements?#

What will I learn?

  • How to view a table of measurements in QuPath

  • How to visualize the distribution of a measurement across cells

  • How to visualize measurements on an image

  • How to generate smoothed versions of measurements

In this section, we’ll continue using OS-2.ndpi. To recap, this shows a tissue sample with different cell types, stained for Ki67. The analysis question we want to answer is:

What percentage of tumour cells are positive for Ki67?

However, images contain a lot of information. There might be some other questions we want to answer as well – perhaps at the level of individual cells.

As it happens, QuPath already generates measurements during cell detection. These include morphological measurements (those relating to cell shape) as well as intensity-based measurements (e.g., the intensity of a nuclear stain).

In this chapter, we’ll examine those measurements. Later, we’ll see how useful they can be to answer our original analysis question.

Define a specific annotation#

../../_images/0-specify-annotation.png

Fig. 62 Specify annotation#

What to do

  1. Open OS-2.ndpi

  2. Run Objects ‣ Delete ‣ Delete all objects

  3. Run Objects ‣ Annotations ‣ Specify annotation… and set the parameters

    • Type: Rectangle

    • X origin: 48000 px

    • Y origin: 26000 px

    • Width: 20000 px

    • Height: 20000 px

  4. Press Add annotation

In this chapter and the next we’ll want to create a large annotation containing a mixture of cell types. Objects ‣ Annotations ‣ Specify annotation… enables us to standardize things so that we should all have exactly the same annotation.

Then, before detecting cells, take some time to calibrate your estimations and discover how good you are at assessing Ki67 by eye.

Question

How many nuclei do you think are visible inside this annotation?

Question

What percentage of all nuclei inside the annotation do you think are Ki67 positive (i.e. brown)?

Detecting cells#

What to do

  1. Run Analyze ‣ Cell detection ‣ Positive cell detection.

  2. Select Optical density sum in the dropdown box for Detection image.

  3. Set Requested pixel size to 1.0 (to speed things up)

  4. Click Run.

This follows the process we used in “How do I count positive cells?” – but without being too fussy about annotating only tumour cells.

../../_images/1-positive-cell-detection-result.jpg

Fig. 63 An annotation containing positive and negative cells of different types#

QuPath’s measurements#

The easiest way to view measurements for cells in QuPath is to open the detection measurement table. This enables you to get an overview of the different measurements made on detections, to sort detections based on measurements, and to visualize the distribution of measurements across all cells.

What to do

  1. Run Measure ‣ Show detection measurements.

  2. Click Show plots.

The plot shown by default is a histogram. This shows a 1-dimensional overview of a single measurement across all cells in the image.

../../_images/2-cell-detection-measurements-hist.png

Fig. 64 QuPath’s detection measurements and a histogram#

As well as histograms, we can investigate the distribution of measurements using scatter plots.

What to do

  1. Click Scatter plot.

  2. Plot Nucleus: DAB OD mean against Nucleus/Cell area ratio

../../_images/3-cell-detection-measurements-scatter.png

Fig. 65 QuPath’s detection measurements and a scatter plot#

Measurement maps#

What to do

  1. Run Measure ‣ Show measurement maps.

  2. Select Nucleus/Cell area ratio.

  3. Choose a colour scheme and enable fill detections (F).

The measurement table allows you to view measurements in isolation. However, it’s also good to view measurements in the context of the image. This can help to reveal spatial patterns among the cells that can be key to understanding the tissue.

../../_images/4-measurement-map.jpg

Fig. 66 A measurement map of nucleus/cell area ratio#

Smoothed measurements#

../../_images/5-measurement-map-select-smooth.png

Fig. 67 Smoothed features window#

What to do

  1. Run Analyze ‣ Calculate features ‣ Add smoothed features…

  2. Enter a radius of 50 and click Run.

  3. Run Measure ‣ Show measurement maps, or click Update map if you left the window open.

  4. Select the smoothed version of Nucleus/Cell area ratio you just created.

  5. Choose a color scheme and enable fill detections (F).

While measurement maps are useful, they are often very granular, and it can be hard to identify more high-level patterns in the image. QuPath can smooth the features among neighbouring cells, which can help pick out where cells in certain regions share similar characteristics.

../../_images/6-cell-detection-measurement-map-smoothed.jpg

Fig. 68 A smoothed nucleus/cell area ratio heatmap#

Challenge: the little cells#

You’ve learned a lot about measurements and classifications in QuPath. But how good are you at crypto-microbiology?

Puzzle

  1. Run File ‣ Save (you’ll need your cells later!)

  2. Open the image noise.tif.

  3. Import new cells from the little-cells.geojson file by dragging & dropping it onto QuPath, or by navigating to File ‣ Import objects from file…

You should see a dense collection of cells.

There is a subpopulation of cells with nucleus properties that are different from the others, and this subpopulation has a chilling message for you.

Use what you’ve learned in this chapter to find this cell subpopulation.