Table of Contents

Cell Segmentation

Overview

Cell segmentation is the process of identifying and masking individual cells in tissue imaging data. Cell segmentation is used to quantify the mean biomarker intensity of all pixels within the cell boundary, and the resulting value, or biomarker expression, is used as a proxy for the amount of protein present in the cell. The features extracted through cell segmentation allow scientists to perform single-cell analysis on the image data.

Many automated methods have been developed to perform cell segmentation, using a wide range of techniques including machine learning, thresholding, and watershed segmentation. On the Enable Platform, we support three segmentation algorithms: DeepCell, Watershed, and StarDist.

Supported algorithms

DeepCell

DeepCell is a deep learning model for image segmentation developed by the Van Valen lab at Caltech, in partnership with the Angelo lab at Stanford. We use their pre-trained machine learning model Mesmer to perform nuclear and whole cell segmentation (DeepCell version 0.12.6). The Mesmer algorithm was trained on TissueNet, an image dataset containing >1 million paired whole-cell and nuclear annotations in numerous human tissue images. The input for this algorithm is a nuclear biomarker and an optional cytoplasmic or membrane biomarker, the latter of which enables whole cell segmentation. For more information about the underlying DeepCell project, you can visit their website DeepCell.org.

Watershed (currently unavailable)

Watershed segmentation is a cell segmentation method that uses the image gradient to identify cell boundaries. It works by treating the image as a topographic map, where the brightness of each pixel represents the elevation. The algorithm then floods the map from local minima, creating basins that correspond to individual cells. By merging basins at higher elevations, the algorithm is able to identify cell boundaries. This method can be useful for segmenting cells with irregular shapes or when other methods are not effective.

StarDist

StarDist is a deep learning based image segmentation method specifically designed for biological images, such as those obtained from microscopy. It uses a convolutional neural network to detect individual cells and other structures in the image. Our implementation of the algorithm has been pre-trained on fluorescent nuclei (StarDist version 0.8.3). StarDist is particularly useful for segmenting cells in densely packed tissue or when other segmentation methods are not effective.

Nuclear vs. whole cell segmentation

All three cell segmentation algorithms start with identification and masking of the nuclei of individual cells in an image. Then, whole cell masks can be generated either by nuclear expansion (pixel dilation) or by whole cell segmentation.

Nuclear Expansion

In the expansion method, a whole cell mask is generated from a nuclear mask by dilating the nuclear mask’s boundaries, using the scikit-image package (Python)’s function skimage.morphology.binary_dilation. Dilation occurs probabilistically for n cycles, where n is specified in num_dilations. Each dilation equates to a given area outside of the nuclear mask, which will vary based on the image resolution and approximately follows the equation: $\mu m \space dilated = \frac 1 2 (\mu m\space per \space pixel)*(number \space dilations)$. At each dilation step, each zero-valued pixel within the given area, where zero-values represent an area not classified as part of a cell, is flipped to a new cell_id value. The cell_id value is determined using a probability equal to the count of all neighboring pixels equal to the new cell_id divided by 4.

For more information about pixel dilation, visit the User Manual.

Whole cell segmentation

Whole cell segmentation identifies cell boundaries using Mesmer, a pre-trained deep learning model. The Mesmer algorithm was trained on TissueNet, an image dataset containing >1 million paired whole-cell and nuclear annotations in numerous human tissue images. The method utilizes an input biomarker that is expressed on the cell membrane in the image. The cell membrane biomarker to be used in a segmentation extension is specified in the Whole Cell Biomarker field. This method is useful for segmenting cells with irregular shapes, where pixel dilation may not be accurate.

Metrics derived from cell segmentation