Session 11 - Non-round cells or other objects#

Goal: learn how to use a pixel classifier to detect oddly shaped cells not well captured by other methods

Myeloid cells are notoriously difficult to segment. They come in a wide variety of shapes and sizes, have processes stuck between other cells, and are not centered on a single nucleus. Here is an example of a single myeloid cell in the tonsil that InstanSeg segmented into 6 separate cells (even though it did a great job on all the rest of the tonsil!)

_images/TonsilMac.gif

To properly segment cells like these, we will need to use a pixel classifier combined with an object classifier.

1. Train a pixel classifier for Tingible Body Macrophages#

  1. Open Tonsil_flip.ome.tif. We do not need the HE overlay for this step.

  2. Turn on the Hoechst (return to white), CD11c, CD68, and CD163 channels. Pick a combination of channel colors that lets you see the 3 markers. Name this display setting “Myeloid”
    _images/Myeloid.PNG

  3. Clean up the class list.

    1. In the Annotation tab, right click on the class list > Reset to default classes

    2. Add the class “TBMacs”

  4. Annotate examples of TBMacs (blue CD68+ and yellow CD11c+). Use Ignore* for the background class.

    • Use the POLYLINE TOOL for precision https://qupath.readthedocs.io/en/0.5/_images/POLYLINE_TOOL.png

    • Make sure you provide TBMacs examples of both the cell border (CD11c+) and cell cytoplasm (CD68+)

    • Focus a lot on the thin/dim cell arms and the edges of the cells

  5. When you have a classifier you are satisfied with, save it as TBMacs. If you are unable to get a reasonable classifier in time, download “Proj2- Overlay and Classifiers” from the BackUp Projects folder and use the one already there.

2. Create Detections from Pixel Classifier#

  1. Save the file. Duplicate the image, saving the new copy as “TBMac training”

  2. Delete all annotations.

  3. Create a full image annotation. Objects > Annotations > Create full image annotation or Ctrl+Shift+A (+Shift+A on Mac)

  4. In the Pixel classifier window, click Create objects

    1. Parent Objects: Selected Object/Current Selection

    2. Use these settings:
      _images/MacDetections.PNG

  5. Close the Pixel classifier window. You should now see ~thousands of potential TBMac objects, including both the cells of interest and other CD11c+ cells that are not tingible body macrophages. _images/Macs_Raw.PNG

  6. Save the file!

3. Use an object classifier to identify the cells of interest#

We are going to use an object classifier to separate the detection objects that represent true TBMacs from other myeloid cells. This is similar to the cell classification we did in Session 6, but the detections start with no measurements, so we’ll have to create some.

  1. Select the cells: Objects > Select > Select all detections or press Ctrl+Alt+D (++D on Mac)

  2. Analyze > Calculate Features > Add shape features

    • Leave everything checked and hit Apply

  3. Analyze > Calculate Features > Add intensity features. Suggested features:

    • Pixel size: 0.65 um

    • Channels: Hoechst, AF1, CD11c, CD68, CD163, CD45, Vimentin

    • Features: Mean, Standard deviation, Min & Max

    • Then click Run

  4. Select the full image rectange. Analyze > Calculate Features > Add smoothed features

    • Radius (FWHM): 100 um

  5. As in Session 6, train an object classifier. Use the classes TBMac and Other. Remember to create annotations that include the centroid.

    • Remember to choose only the useful features!

    • Save the classifier as “TBMacs_obj”

_images/MacsClassified.PNG
  1. Clean up.

    1. Save the file!

    2. Duplicate the image as “TBMacs_obj training”

    3. Delete all of the training annotatinons