jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Cell Detection

cell-detection

蛍光顕微鏡画像から細胞を自動で検出し、形態計測データやオーバーレイ画像を生成するSkill。

⏱ ボイラープレート実装 半日 → 30分

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

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。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-17
同梱ファイル
1

💬 こう話しかけるだけ — サンプルプロンプト

  • Cell Detection を使って、最小構成のサンプルコードを示して
  • Cell Detection の主な使い方と注意点を教えて
  • Cell Detection を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Claude が読む原文 SKILL.md(中身を展開)

この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。

🔬 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

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.

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. Reportreport.md + {stem}_measurements.csv + reproducibility bundle (commands.sh, environment.yml, checksums.sha256)

CLI Reference

# 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

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