Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Cellpose: cell segmentation

What it does

Cellpose draws an outline around every cell, or every nucleus, in an image. It is a single deep-learning model, trained on many kinds of images, that works on new images without retraining.

Parameters

More in Methods and targets and Many markers with Cellpose.

How it works

For every pixel the network predicts the probability of being inside a cell, and two flow maps, horizontal and vertical, that point towards the cell’s centre. Following the flows from every pixel groups the pixels into cells, one mask each Stringer et al., 2020.

This pipeline runs Cellpose-SAM, which keeps that output but replaces the network with the image encoder of SAM, a large general-purpose segmentation model. It was trained to ignore channel order and to cope with cell diameters from 7.5 to 120 px, so it needs no diameter estimate, with a small loss of accuracy on very small cells Pachitariu et al., 2025. The model is built into the container, so nothing is downloaded during a run.

Cellpose runs on every patch separately; the patches are then joined. If it segmented both cells and nuclei, they are linked. Cellpose-SAM is slow without a GPU: about 24 s per 1200 px crop on an Apple GPU.

Inputs and outputs. In: one patch of the image, as one or two channels: a cell channel and a nuclear channel for cells, the nuclear channel alone for nuclei. Out: polygons in the store, cellpose_cells and with nuclei cellpose_nuclei, then a table cellpose_table after quantification. See The SpatialData store.

Similar tools

Cellpose is a widely used generalist model. Cellpose-SAM replaced Cellpose 3 (cyto3): in the projection benchmark Cyto3 fell back to nuclei where Cellpose-SAM found whole cells, at about eight times the run time. StarDist was dropped in 2.0, since Cellpose and InstanSeg also segment nuclei.

Read more

Version used:

ModuleToolVersionContainerPaper
SEGMENT_PATCHCellpose4.2.1.1docker.io/josenimo/sopa:2.3.0-1Pachitariu et al. (2025)
References
  1. Stringer, C., Wang, T., Michaelos, M., & Pachitariu, M. (2020). Cellpose: a generalist algorithm for cellular segmentation. Nature Methods, 18(1), 100–106. 10.1038/s41592-020-01018-x
  2. Pachitariu, M., Rariden, M., & Stringer, C. (2025). Cellpose-SAM: superhuman generalization for cellular segmentation. 10.1101/2025.04.28.651001
  3. Schmidt, U., Weigert, M., Broaddus, C., & Myers, G. (2018). Cell Detection with Star-Convex Polygons. In Medical Image Computing and Computer Assisted Intervention – MICCAI 2018 (pp. 265–273). Springer International Publishing. 10.1007/978-3-030-00934-2_30
  4. Greenwald, N. F., Miller, G., Moen, E., Kong, A., Kagel, A., Dougherty, T., Fullaway, C. C., McIntosh, B. J., Leow, K. X., Schwartz, M. S., Pavelchek, C., Cui, S., Camplisson, I., Bar-Tal, O., Singh, J., Fong, M., Chaudhry, G., Abraham, Z., Moseley, J., … Van Valen, D. (2021). Whole-cell segmentation of tissue images with human-level performance using large-scale data annotation and deep learning. Nature Biotechnology, 40(4), 555–565. 10.1038/s41587-021-01094-0