What it does¶
Cellpose looks at two images: a nuclear stain and a cell stain. Projection builds that cell image from all the membrane and cytoplasm markers of your panel, so Cellpose sees every cell type, not only those one marker labels.
Parameters¶
use_projection: turns it on. Needsuse_cellpose, and the pipeline must stitch the image (it reads the marker sheet); leavecellpose_channelsunset.keep_projection: keep the projected image in the store, to view it under the cell outlines.projection_method: combine markers by maximum (default) or mean.projection_low_percentileandprojection_high_percentile, default 1 and 99.9: each marker’s brightness range.projection_sigma, default 0: smoothing, off since the segmentation benchmark.The marker sheet decides which marker goes where; see below.
More in Many markers with Cellpose.
How it works¶
For each of the two output images, nuclear and cell, every marker in its group is:
rescaled to 0–1 between its own low and high percentile, with pixels of exactly 0 left out;
smoothed with a Gaussian, if
projection_sigmais above 0;combined with the group’s other markers, pixel by pixel, by maximum (or mean).
The groups come from the marker sheet’s segmentation column if any row has a value. Otherwise
nuclear is the first dna channel, and cell is every marker whose channel_compartment
includes membrane or cytoplasm.
Only Cellpose reads the projection. InstanSeg and quantification read the full image, so every marker is still measured on its own.
Inputs and outputs. In: the image in the SpatialData store and the marker
sheet. Out: an image <image>_projected with two channels, nuclear and cell, deleted at the
end unless keep_projection; and a preview, qc/{sample}_projection.png, with a
qc/{sample}_projection.json that lists each marker’s share of the pixels in which it is the
brightest. A marker brightest in over half of its image is listed as dominant, and the log
warns: it may be hiding the others. See QC files.
Similar tools¶
Pick one membrane marker, as
cellpose_channelsdoes: simple, but cells without that marker are missed or drawn from the nucleus alone.Sum or average the markers: averaging dims markers found on one cell type only.
InstanSeg reads every marker itself, with no projection.
The defaults come from a benchmark on two crops with Cellpose 3 and Cellpose-SAM, judged by eye with metrics as support; there was no ground truth.
Maximum, not mean. With mean, Cellpose-SAM missed a whole lymphocyte cluster (72 % of nuclei inside a cell, against 95 % with maximum).
Projection beats DNA alone. On exemplar-001, nuclei inside a cell rose from 86 % to 99 %, and CD45-positive pixels inside a cell from 65 % to 84 %.
Zeros are left out. Stitching pads unregistered areas with zeros; counting them put the floor below the background, and one dim marker then lit up the glass.
Nuclear is the first
dnachannel: the stitching reference, the best aligned, and free of the cell loss later cycles show.No smoothing. The later segmentation benchmark, against manual outlines, found that any
projection_sigmalowered F1.
Read more¶
How the defaults were chosen: decisions.md and the benchmark script.
Version used:
| Module | Tool | Version | Container | Paper |
|---|---|---|---|---|
| PROJECT_CHANNELS | sopa | 2.2.9 | community.wave.seqera.io/library/python_sopa:54a97bc5a187152d |