Delineates single cells in multiplexed IMC/MIBI images so that averaging channels inside each mask yields a single-cell expression table. What dominates everything downstream: segmentation is the single largest, irreversible source of error in the experiment -- under-segmentation fabricates impossible double-positive cell types while over-segmentation quietly miscounts cells and corrupts spatial statistics, and both are confounded with lateral signal spillover across cell boundaries.
# steinbock orchestrates DeepCell/Mesmer and Cellpose
pip install steinbock deepcell cellpose scikit-image numpy tifffile
# Docker container alternative
docker pull ghcr.io/bodenmillergroup/steinbock
Tell your AI agent what you want to do: - "Segment whole cells with Mesmer using my DNA and membrane channels" - "Build a membrane channel that covers all my cell types" - "Fall back to nuclear segmentation plus expansion -- my membrane staining is poor" - "Check my segmentation for impossible double-positive cells" - "Run steinbock cellpose segmentation and extract per-cell mean intensities"
"Run Mesmer whole-cell segmentation on this IMC image. My resolution is 1 um/pixel -- set image_mpp correctly."
"Which markers should I sum into the membrane channel so I don't under-segment my B cells and macrophages?"
"My only good membrane marker is CD45 and it only stains immune cells. What is the least-biased way to get whole-cell masks?"
"I have a CD3+CD20+ cluster. Is it real, and how do I tell if it is a segmentation artifact?"
image_mpp/diameter, then aggregate per-cell MEAN intensities.image_mpp (~1.0 IMC); the default rescales cells to the wrong size.diameter deliberately at IMC scale, or use cpsam which removes the diameter dependence.expand_labels) expansion, never free dilation -- free dilation double-counts boundary pixels.