Skip to content

birkhoffkiki/PrePATH

Repository files navigation

PrePATH: A Toolkit for Preprocessing Whole Slide Images

PrePath logo


Live Benchmark PathBench-MIL Paper

Tip

🚀 Contribute Your Foundation Model! We welcome submissions of new pathology foundation models to our benchmark. 👉 Submit Your Model Here — Help advance the field by adding your model to PrePATH!


PrePATH is a comprehensive preprocessing toolkit for whole slide images (WSI), built upon CLAM and ASlide.

TODO

  • H0-mini
  • OpenMidnight
  • TITAN (Slide level)

Installation

Prerequisites

  • Anaconda or Miniconda
  • openslide-tools (system dependency)

Setup Instructions

The following instructions demonstrate installation for the GPFM model. For other foundation models, please refer to their respective repositories for environment-specific requirements.

git clone https://github.com/birkhoffkiki/PrePATH.git
cd PrePATH
conda create --name gpfm python=3.10
conda activate gpfm
pip install -r requirements/gpfm.txt
cd models/ckpts/
wget https://github.com/birkhoffkiki/GPFM/releases/download/ckpt/GPFM.pth

Notes:

  • ASlide should be installed as a Python package from GitHub and is included in requirements/gpfm.txt.
  • Environment configurations for other foundation models should be referenced from their respective repositories.

Usage

Step 1: Patch Coordinate Extraction

Extract coordinates of foreground patches from whole slide images:

# Configure variables in the script before execution
bash scripts/get_coors/SAL/sal.sh

Step 2: Feature Extraction

Extract patch-level features using the selected foundation model:

# Refer to the script for detailed configuration options
bash scripts/extract_feature/sal.sh

Supported Foundation Models

PrePATH supports multiple state-of-the-art foundation models for patch-level feature extraction. To extract features using specific models (e.g., ResNet50 and GPFM), configure the models parameter in scripts/extract_feature/exe.sh:

models="resnet50 gpfm"

Note: Each foundation model requires its corresponding Python environment to be properly configured.

Model Identifier Reference
ResNet50 resnet50 Standard ImageNet pretrained model
GPFM gpfm GitHub
CTransPath ctranspath GitHub
PLIP plip GitHub
CONCH conch HuggingFace
CONCH-1.5 conch15 HuggingFace
UNI uni HuggingFace
UNI-2 uni2 HuggingFace
mSTAR mstar GitHub
Phikon phikon HuggingFace
Phikon2 phikon2 HuggingFace
Virchow-2 virchow2 HuggingFace
Prov-GigaPath gigapath HuggingFace
CHIEF chief GitHub
H-Optimus-0 h-optimus-0 HuggingFace
H0-mini h0-mini HuggingFace
H-Optimus-1 h-optimus-1 HuggingFace
OpenMidnight openmidnight HuggingFace
Lunit lunit GitHub
Hibou-L hibou-l GitHub
MUSK musk HuggingFace
OmiCLIP omiclip Github
PathoCLIP pathoclip Github

Supported WSI Formats

PrePATH supports the following whole slide image formats:

  • KFB (.kfb)
  • SDPC (.sdpc)
  • TRON (.tron)
  • All formats supported by OpenSlide (including .svs, .tiff, .ndpi, .vms, .vmu, .scn, .mrxs, .tif, .bif, and others)

About

PrePATH: A parallel toolkit for Preprocessing WSI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7