Cell segmentation in fluorescence microscopy images. Supports Cellpose/cpsam (Cellpose 4.0) with additional backends planned. Produces segmentation masks, per-cell morphology metrics (area, diameter, centroid, eccentricity), overlay figures, and a report.md.
You are the cell-detection agent, a specialised ClawBio skill for cell
segmentation in fluorescence microscopy images. The default backend is cpsam
(Cellpose 4.0); additional backends (e.g. StarDist) are planned.
Manual cell counting and segmentation are slow, inconsistent, and hard to reproduce.
report.md.cpsam on any TIFF, PNG, or JPG fluorescence imagereport.md, {stem}_measurements.csv, and histogram figures| Format | Extension | Notes |
|---|---|---|
| Greyscale TIFF | .tif, .tiff | HĆW ā passed directly |
| 2-channel TIFF | .tif, .tiff | HĆWĆ2 ā cytoplasm + nuclear, any order |
| 3-channel TIFF | .tif, .tiff | HĆWĆ3 ā H&E or fluorescence, any order |
| >3-channel TIFF | .tif, .tiff | First 3 channels used; remainder truncated with warning |
| PNG / JPEG | .png, .jpg, .jpeg | Greyscale or RGB |
Channel handling: cpsam is channel-order invariant ā cytoplasm and nuclear channels can be in any order. You do not need to specify which channel is which. If you have more than 3 channels, consider omitting the extra channel or combining it with another before running.
CellposeModel() ā no channels argument neededskimage.measure.regionpropsreport.md + {stem}_measurements.csv + reproducibility bundle (commands.sh, environment.yml, checksums.sha256)# Standard usage ā greyscale or multi-channel (cpsam handles channels automatically)
python skills/cell-detection/cell_detection.py \
--input <image.tif> --output <report_dir>
# Override diameter estimate (pixels)
python skills/cell-detection/cell_detection.py \
--input <image.tif> --diameter 30 --output <report_dir>
# Demo (synthetic image, no user file needed)
python skills/cell-detection/cell_detection.py --demo --output /tmp/cell_detection_demo
python skills/cell-detection/cell_detection.py --demo --output /tmp/cell_detection_demo
Expected output: report.md with ~67 cells detected from a synthetic 512Ć512 blob image (67 blobs generated).
tifffile (TIFF) or PIL (PNG/JPG); detect ndimCellposeModel(gpu=<flag>)model.eval(img, diameter=<arg_or_None>) ā no channels arg (cpsam is channel-order invariant)masks via skimage.measure.regionprops{stem}_measurements.csv, figures, report.mdKey parameters:
cpsam (Cellpose 4.0 unified model ā channel-order invariant)None triggers Cellpose auto-estimationoutput_dir/
āāā report.md
āāā {stem}_measurements.csv
āāā {stem}_cp_masks.tif
āāā {stem}_seg.npy
āāā figures/
ā āāā {stem}_cp_outlines.png
ā āāā {stem}_histogram.png
āāā reproducibility/
āāā checksums.sha256
āāā commands.sh
āāā environment.yml
cellpose>=4.0 ā cpsam modeltifffile ā TIFF I/OPillow ā PNG/JPG loadingnumpy ā array opsmatplotlib ā figuresscikit-image ā regionprops metricscommands.sh, environment.yml, checksums.sha256) records the exact invocation, dependencies, and output integrityTrigger conditions:
Chaining partners: