# Cell Detection

Cell segmentation in fluorescence microscopy images.

- Repository: https://github.com/ClawBio/ClawBio (1172 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add ClawBio/ClawBio --skill cell-detection -g -a claude-code -y`
Codex: `npx skills add ClawBio/ClawBio --skill cell-detection -g -a codex -y`
Cursor: `npx skills add ClawBio/ClawBio --skill cell-detection -g -a cursor -y`
Gemini CLI: `npx skills add ClawBio/ClawBio --skill cell-detection -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add ClawBio/ClawBio`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 🔬 Cell Segmentation

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.

## Why This Exists

Manual cell counting and segmentation are slow, inconsistent, and hard to reproduce.

- **Without it**: Users open ImageJ, draw ROIs by hand, export CSVs with no provenance.
- **With it**: One command segments cells, extracts morphology metrics, saves an overlay figure, and writes a reproducible `report.md`.
- **Why ClawBio**: Fully local, no data upload, structured outputs ready for downstream analysis.

## Core Capabilities

1. **Segment**: Run `cpsam` on TIFF, CZI, ND2, PNG, or JPG fluorescence images
2. **Measure**: Extract area, equivalent diameter, centroid, and eccentricity per cell
3. **Report**: Produce `report.md`, `{stem}_measurements.csv`, and histogram figures
4. **Execution control**: GPU auto by default, with explicit `--use_gpu` / `--use_cpu` override flags

## Input Formats

| 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 |
| Zeiss microscopy | `.czi` | Reads CZI via `czifile` and uses CZI axis metadata (`CziFile.axes`) to map C/Z/Y/X deterministically |
| Nikon microscopy | `.nd2` | Reads ND2 via `nd2` and uses ND2 named dimensions (`ND2File.sizes`) for deterministic C/Z/Y/X mapping |
| PNG / JPEG | `.png`, `.jpg`, `.jpeg` | Greyscale or RGB |

The rest: https://github.com/ClawBio/ClawBio/blob/HEAD/skills/cell-detection/SKILL.md
