mubashermohammed/opencode-bioinfo/cell-detection

Claude Code and agent skill by mubashermohammed/opencode-bioinfo

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

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.

Install

npx vskill@latest install mubashermohammed/opencode-bioinfo/cell-detection

SKILL.md

The same SKILL.md was published earlier as mubashermohammed/opencode-bioinfo/cell-detection.

πŸ”¬ 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 any TIFF, PNG, or JPG fluorescence image
  2. Measure: Extract area, equivalent diameter, centroid, and eccentricity per cell
  3. Report: Produce report.md, {stem}_measurements.csv, and histogram figures

Input Formats

FormatExtensionNotes
Greyscale TIFF.tif, .tiffHΓ—W β€” passed directly
2-channel TIFF.tif, .tiffHΓ—WΓ—2 β€” cytoplasm + nuclear, any order
3-channel TIFF.tif, .tiffHΓ—WΓ—3 β€” H&E or fluorescence, any order
>3-channel TIFF.tif, .tiffFirst 3 channels used; remainder truncated with warning
PNG / JPEG.png, .jpg, .jpegGreyscale 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.

Workflow

  1. Load image; detect greyscale vs multi-channel
  2. Prepare β€” pass 1–3 channels through unchanged; truncate >3 to first 3 with a warning
  3. Segment with CellposeModel() β€” no channels argument needed
  4. Metrics via skimage.measure.regionprops
  5. Figures β€” overlay + size distribution histogram
  6. Report β€” report.md + {stem}_measurements.csv + reproducibility bundle (commands.sh, environment.yml, checksums.sha256)

CLI Reference

bash
# 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

Demo

bash
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).

Algorithm / Methodology

  1. Load image with tifffile (TIFF) or PIL (PNG/JPG); detect ndim
  2. If >3 channels, truncate to first 3 with a warning
  3. Instantiate CellposeModel(gpu=<flag>)
  4. Call model.eval(img, diameter=<arg_or_None>) β€” no channels arg (cpsam is channel-order invariant)
  5. Extract per-cell stats from masks via skimage.measure.regionprops
  6. Save {stem}_measurements.csv, figures, report.md

Key parameters:

  • Model: cpsam (Cellpose 4.0 unified model β€” channel-order invariant)
  • Channels: not passed β€” cpsam uses the first 3 channels of the input in any order
  • Diameter: None triggers Cellpose auto-estimation

Example Queries

  • "Segment the cells in my DAPI image"
  • "How many cells are in this microscopy image?"
  • "Run cellpose on my TIFF and give me a cell count"
  • "Segment my fluorescence image and export morphology metrics"

Output Structure

output_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

Dependencies

  • cellpose>=4.0 β€” cpsam model
  • tifffile β€” TIFF I/O
  • Pillow β€” PNG/JPG loading
  • numpy β€” array ops
  • matplotlib β€” figures
  • scikit-image β€” regionprops metrics

Safety

  • Local-first: no image data leaves the machine
  • Every report includes the ClawBio medical disclaimer
  • Reproducibility bundle (commands.sh, environment.yml, checksums.sha256) records the exact invocation, dependencies, and output integrity

Integration with Bio Orchestrator

Trigger conditions:

  • Input is a TIFF/PNG/JPG microscopy image
  • User mentions "cellpose", "segment", "cell counting", "microscopy"

Chaining partners:

  • Future: export ROI centroids to spatial transcriptomics workflows

Citations

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Grok Build (Cursor)
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mubashermohammed/opencode-bioinfo/cell-detection/badge)](https://verified-skill.com/skills/mubashermohammed/opencode-bioinfo/cell-detection)

Something wrong with this skill or its page? Tell us.