This software implements the pipeline for the Pancreas cancer detection project. The repo contains codes to perform the prediction to detect Pancreatic cancer in Whole Slide Images. The paper was published in MICCAI 2019 "Pancreatic Cancer Detection in Whole Slide Images Using Noisy Label Annotations"
- Output heatmaps: *.png files, pixel's value is the predicted probability of the patch to contain cancerous cells. Download output heatmaps here.
- Pytorch 0.4.0
- Torchvision 0.2.0
- cv2 (3.4.1)
- Openslide 1.1.1
- sklearn
- PIL
-
scripts/: contains scripts that connect several sub-functionalities together for complete functionalities such as generating camicroscope heatmaps given svs images.
-
conf/: contains configuration.
-
data/: a place where should contain all logs, input/output images, trained CNN models, and large files.
-
download_heatmap/: downloads grayscale lymphocyte or tumor heatmaps
-
heatmap_gen/: generate json files that represents heatmaps for camicroscope, using the lymphocyte and necrosis CNNs' raw output txt files.
-
patch_extraction_tumor_40X/: extracts all patches from svs images. Mainly used in the test phase.
-
prediction/: CNN prediction code.
-
training_codes/: CNN training code.
- Change the BASE_DIR to the path of your folder after you clone the git repo
- Go to folder "training_codes", run python paad_baseline_preact-res34_AUC_exclude_valSlides.py
- Go to folder "scripts", run bash svs_2_heatmap.sh
Build the docker image by:
docker build -t paad_detection .
(Note the dot at the end).
Create folder named "data" and subfolders below on the host machine:
- data/svs: to contains *.svs files
- data/patches: to contain output from patch extraction
- data/log: to contain log files
- data/heatmap_txt: to contain prediction output
- data/heatmap_jsons: to contain prediction output as json files
- Run the docker container as follows:
nvidia-docker run --name paad-detection -itd -v <path-to-data>:/data -e CUDA_VISIBLE_DEVICES='<cuda device id>' paad_detection svs_2_heatmap.sh
CUDA_VISIBLE_DEVICES -- set to select the GPU to use
The following example runs the cancer detection pipeline. It will process images in /home/user/data/svs and output the results to /home/user/data.
nvidia-docker run --name paad-detection -itd -v /home/user/data:/data -e CUDA_VISIBLE_DEVICES='0' paad_detection svs_2_heatmap.sh
@inproceedings{le2019paad,
title={Pancreatic Cancer Detection in Whole Slide Images Using Noisy Label Annotations},
author={Han, Le and Dimitris, Samaras and Tahsin, Kurc and Rajarsi, Gupta and Kenneth, Shroyer and Joel, Saltz },
booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
year={2019},
organization={Springer}
}