What it does¶
When a method segments both nuclei and whole cells, linking decides which nucleus belongs to which cell, and from that draws each cell’s cytoplasm: the cell minus its nucleus.
Parameters¶
segment_cells and
segment_nuclei, both on: linking then runs for
each method. Nothing else changes it; the one-half rule below is fixed. See
Methods and targets.
How it works¶
Nuclei and cells are segmented in two separate passes, so they share nothing but their outlines. Linking pairs them by overlap, after the patches are joined, when the outlines are final:
A nucleus links to the cell that holds the largest share of its area, if that share is at least half. A tie goes to the cell listed first.
A cell’s nucleus compartment is the union of its linked nuclei, clipped to the cell.
Its cytoplasm is the cell minus that compartment. It can be a ring, or several pieces.
Nothing is dropped: an unlinked nucleus is kept, and a cell without a nucleus is kept.
Left: the nucleus lies inside the cell, so it is linked, and the rest of the cell is cytoplasm. Right: less than half of the nucleus lies inside, so it is not linked; the cell has no nucleus, so no cytoplasm is defined.
A cell without a nucleus has no cytoplasm value (“not measured”, NaN); a cell its nuclei fill has a cytoplasm area of 0 (“measured, nothing there”).
Inputs and outputs. In: one method’s resolved cells and nuclei. Out, in the store:
{m}_nuclei with a linked_cell_id per nucleus, and {m}_cytoplasm; per cell, the number of
nuclei, the largest linked nucleus and the nucleus and cytoplasm areas. Quantification
measures the nucleus compartment and the cytoplasm as extra table layers. The QC report counts
cells by number of nuclei, unlinked nuclei, and cells their nuclei fill. See
The SpatialData store.
Similar tools¶
Expanding nuclei by a fixed distance to approximate cells, as QuPath’s cell detection does (Bankhead et al. 2017): one segmentation, but the cell shape is guessed, not seen.
Models that return nuclei and cells together, matched by construction.
Here each method segments cells from the membrane markers, so linking by geometry is what lets one run measure nuclei, cells and cytoplasm from the same outlines.
Read more¶
The design, with the linking rules.
Shapely, which does the geometry.
Version used:
| Module | Tool | Version | Container | Paper |
|---|---|---|---|---|
| LINK_COMPARTMENTS | geopandas | 2.3.0-1 | docker.io/josenimo/sopa:2.3.0-1 |
- Bankhead, P., Loughrey, M. B., Fernández, J. A., Dombrowski, Y., McArt, D. G., Dunne, P. D., McQuaid, S., Gray, R. T., Murray, L. J., Coleman, H. G., James, J. A., Salto-Tellez, M., & Hamilton, P. W. (2017). QuPath: Open source software for digital pathology image analysis. Scientific Reports, 7(1). 10.1038/s41598-017-17204-5