/HEIP

Primary LanguagePythonMIT LicenseMIT

HEIP

HEIP (HE-image-analysis-pipeline): set of tools to run end-to-end HE-image analysis

schema

Generic badge Python - Version

Introduction

HEIP is a fully fledged pipeline for extracting cell level information from hematoxylin and eosin (H&E) whole slides. It consists of different steps and related tools ranging from HE-image patching, pre-processing, cell segmentation and classification, until downstream feature extraction. The pipeline, written entirely in Python, is modular and it is easy to add additional or modify existing steps.

To demonstrate the potential of HEIP, the pipeline was applied to analyze high-grade serous carcinoma H&E slides and the complete study is available in Journal of Pathology Informatics at this link

Set Up

  1. Clone the repository
git clone git@github.com:ValeAri/HEIP_HE-image-analysis-pipeline.git
  1. cd to the repository cd <path>/HEIP_HE-image-analysis-pipeline/

  2. Create environment with python >3.7 and <3.11 (optional but recommended)

conda create --name HEIP python
conda activate HEIP

or

python3 -m venv HEIP
source HEIP/bin/activate
pip install -U pip
  1. Install dependencies
pip install -r requirements.txt
  1. Model

Instance segmenatation model available here!

Notebook examples

  1. Patching HE images.
  2. Pre-process HE images.
  3. Train a segmentation model for HE images with a training set.
  4. Run inference with the segmentation model.
  5. Merge cell annotations.
  6. Morphological features extraction from all cells in the WSI.

Run instance segmentation training and inference with SLURM from CLI

NOTE You might want to modify the batchscripts to your needs (setting up right paths etc).

Training

cd HEIP_HE-image-analysis-pipeline/
sbatch ./batchscripts/train.sh

Inference

cd HEIP_HE-image-analysis-pipeline/
sbatch ./batchscripts/infer_wsi.sh