pathml
Full-featured computational pathology toolkit. Use for advanced WSI analysis including multiplexed immunofluorescence (CODEX, Vectra), nucleus segmentation, tissue graph construction, and ML model training on pathology data. Supports 160+ slide formats. For simple tile extraction from H&E slides, histolab may be simpler.
Author
Category
Image ProcessingInstall
Hot:14
Download and extract to your skills directory
Copy command and send to OpenClaw for auto-install:
Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-scientific-skills-pathml&locale=en&source=copy
PathML - End-to-end Computational Pathology Analysis Toolkit
Capabilities Overview
PathML is a full-featured Python computational pathology toolkit for processing and analyzing whole-slide images (WSI). It supports 160+ vendor formats and provides a complete workflow from image loading and preprocessing to cell segmentation and machine learning model training.
Use Cases
1. H&E-stained Tissue Slide Analysis
Process routine H&E-stained pathology slides, including tissue region detection, stain normalization, nuclei segmentation and classification, feature extraction, and spatial graph construction. Supports mainstream formats such as Aperio SVS, Hamamatsu NDPI, and Leica SCN.
2. Multiplex Imaging Analysis (CODEX/Vectra)
Analyze spatial proteomics and gene expression data from platforms like CODEX, Vectra, MERFISH, supporting cell segmentation (Mesmer model), marker expression quantification, and export to AnnData for single-cell analysis.
3. Pathology Image Machine Learning Model Training
Use built-in pretrained models such as HoVer-Net and HACTNet, or train custom deep learning models for nucleus detection, segmentation, and classification. Supports PyTorch integration and ONNX inference deployment.
Key Features
1. Multi-format WSI Loading and Preprocessing
Unified interface for loading 160+ vendor formats (SVS, NDPI, SCN, ZVI, DICOM, OME-TIFF, etc.), automatically handling image pyramids and metadata. Provides a modular preprocessing pipeline including stain normalization (Macenko/Vahadane), tissue detection, nuclei segmentation, quality control, and other transforms.
2. Spatial Graph Construction and Analysis
Extract features from segmented objects to build cell- and tissue-level spatial relationship graphs, suitable for graph neural networks and spatial analysis. Supports tissue graph construction, feature extraction, and spatial analysis workflows.
3. Deep Learning Model Integration
Integrates models such as HoVer-Net (simultaneous nuclei segmentation and classification) and HACTNet (hierarchical cell type classification), provides PyTorch DataLoader and ONNX inference support, and can handle public pathology datasets.
Frequently Asked Questions
Which should I choose, PathML or histolab?
If you only need to simply extract tiles from H&E slides, histolab may be lighter and simpler. If you need advanced features like multiplex immunofluorescence analysis, nuclei segmentation, tissue graph construction, or ML model training, PathML is the more comprehensive choice.
Which slide formats does PathML support?
PathML supports 160+ vendor proprietary formats, including Aperio SVS, Hamamatsu NDPI, Leica SCN, Zeiss ZVI, DICOM, OME-TIFF, etc. It automatically handles format differences and provides a unified access interface.
How do I process CODEX data with PathML?
Use
CODEXSlide to load the data, merge multi-run channel data, apply the Mesmer model for cell segmentation, quantify marker expression, and finally export to AnnData for downstream single-cell analysis. See references/multiparametric.md.