← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-imaging-mass-cytometry-cell-segmentation / references / usage-guide.md

Cell Segmentation - Usage Guide

Overview

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.

Prerequisites

# steinbock orchestrates DeepCell/Mesmer and Cellpose
pip install steinbock deepcell cellpose scikit-image numpy tifffile

# Docker container alternative
docker pull ghcr.io/bodenmillergroup/steinbock

Quick Start

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"

Example Prompts

Whole-cell segmentation

"Run Mesmer whole-cell segmentation on this IMC image. My resolution is 1 um/pixel -- set image_mpp correctly."

Membrane-channel decision

"Which markers should I sum into the membrane channel so I don't under-segment my B cells and macrophages?"

Fallback

"My only good membrane marker is CD45 and it only stains immune cells. What is the least-biased way to get whole-cell masks?"

Evaluation

"I have a CD3+CD20+ cluster. Is it real, and how do I tell if it is a segmentation artifact?"

What the Agent Will Do

  1. Choose a segmenter from the decision tree (Mesmer first for whole-cell; nuclei+expansion when membrane staining is weak; ilastik+CellProfiler for transparency).
  2. Build the nuclear and summed-membrane inputs, covering all cell types in the membrane sum.
  3. Run segmentation with the true image_mpp/diameter, then aggregate per-cell MEAN intensities.
  4. Apply lateral-spillover compensation (REDSEA) after segmentation when membrane double-positives are heavy.
  5. Evaluate on downstream proxies -- impossible-co-expression rate, count/density sanity, positive-fraction stability across segmenters -- not F1/IoU alone.

Tips