Skills pathml
🔬

pathml

Safe ⚡ Contains scripts⚙️ External commands🌐 Network access📁 Filesystem access

Analyze pathology slides with machine learning

Also available from: davila7

PathML streamlines computational pathology workflows by providing unified tools for loading diverse slide formats, preprocessing images, and training ML models. Researchers can analyze whole-slide images, build tissue graphs, and quantify multiplex immunofluorescence data in a single framework.

Supports: Claude Codex Code(CC)
🥉 73 Bronze
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

Toggle on and start using

Test it

Using "pathml". Load slide.svs and apply stain normalization

Expected outcome:

  • ✓ Loaded slide.svs (40x magnification, 89600×76800 pixels)
  • ✓ Applied Macenko stain normalization to target image
  • ✓ Detected 12 tissue regions across 4 levels
  • ✓ Generated 2,847 tiles (256×256) from tissue areas
  • ✓ Normalization complete - stains now consistent across batch

Using "pathml". Segment nuclei with HoVer-Net

Expected outcome:

  • ✓ Loaded HoVer-Net model with 5 nuclear categories
  • ✓ Processed 2,847 tiles in 4.2 minutes (GPU)
  • ✓ Detected 124,856 nuclei across sample
  • ✓ Generated segmentation masks and classification maps
  • ✓ Nuclear counts by type: epithelial (45K), fibroblast (32K), immune (28K), other (20K)

Using "pathml". Analyze CODEX multiplex data

Expected outcome:

  • ✓ Loaded CODEX dataset (30 markers, 4 runs)
  • ✓ Collapsed multi-run data into single multichannel image
  • ✓ Segmented 45,231 cells using Mesmer
  • ✓ Extracted marker expression per cell (median intensity)
  • ✓ Exported to AnnData for downstream analysis

Security Audit

Safe
v4 • 1/17/2026

PathML is a legitimate open-source computational pathology toolkit. All 554 static findings are false positives - the scanner detected patterns in markdown documentation (code examples) rather than actual executable code. The 'eval()' detections are PyTorch's model.eval() method, not dynamic code execution. Shell command patterns are documentation examples for batch processing workflows. No malicious intent, data exfiltration, or security vulnerabilities confirmed.

8
Files scanned
4,409
Lines analyzed
4
findings
4
Total audits
Audited by: claude View Audit History →

Quality Score

45
Architecture
100
Maintainability
87
Content
30
Community
100
Security
91
Spec Compliance

What You Can Build

Segment nuclei in H&E stained tissues

Load whole-slide images, apply preprocessing pipelines, and use HoVer-Net to detect and classify cell nuclei for quantitative analysis.

Analyze CODEX multiplex imaging data

Process multi-run CODEX experiments, segment cells with Mesmer, and quantify protein marker expression for spatial proteomics.

Train custom pathology models

Use PathML's PyTorch integration to train deep learning models on public datasets like PanNuke with optimized data loading.

Try These Prompts

Basic WSI loading
Load the SVS file at data/slide.svs using PathML and display the image pyramid structure. Show me what levels are available and their dimensions.
Preprocessing pipeline
Create a PathML pipeline that detects tissue regions, normalizes H&E stains using Macenko method, and removes artifacts from slide.svs
Nucleus segmentation
Use PathML's HoVer-Net model to segment nuclei in the preprocessed slide. Extract segmentation masks and classify nucleus types.
Build tissue graphs
From the segmented nuclei, construct a spatial graph where nodes are cells and edges connect neighboring cells. Extract graph features for downstream analysis.

Best Practices

  • Always use appropriate slide class for your image format (SVSSlide, CODEXSlide, etc.)
  • Generate tiles at appropriate resolution for your analysis - use level parameter to balance detail vs performance
  • Apply stain normalization before training ML models to reduce batch effects

Avoid

  • Don't load entire WSI into memory - use tiling and memory mapping for large slides
  • Avoid training models on unnormalized images from different scanners or labs
  • Don't use generic image loading libraries - PathML handles metadata and pyramid levels correctly

Frequently Asked Questions

What slide formats does PathML support?
PathML supports 160+ formats including Aperio SVS, Hamamatsu NDPI, Leica SCN, Zeiss formats, DICOM, and standard TIFF.
How do I handle memory issues with large slides?
Use tile-based processing with generate_tiles(), specify appropriate level parameter, and save intermediate results to HDF5.
Can PathML train custom deep learning models?
Yes, PathML integrates with PyTorch and provides pre-built models like HoVer-Net. You can also implement custom architectures.
What is the difference between HoVer-Net and HACT-Net?
HoVer-Net segments individual nuclei, while HACT-Net classifies cell types hierarchically across tissue regions.
How do I analyze CODEX multiplex data?
Use CODEXSlide class, collapse multi-run data, segment with Mesmer, then quantify marker expression per cell.
Can I use PathML for commercial projects?
PathML uses GPL-2.0 license which may have restrictions. Check license terms for commercial usage requirements.