Home

Awesome

PresentationImg

Automatic assessment of LNEN tumor proliferative active with Pathonet:

Supervised deep learning network dedicated to the detection of Ki-67 or PHH3 positive cells on immunostained whole slide images (WSI). This network is an adaptation of the Pathonet model for pulmonary neuroendocrine neoplasms (LNEN); it classifies cells according to two classes, either negative or positive to an immunomarker. This directory also allows the creation of spatial statistics based on graph construction, as proposed by Bullloni and colleagues See : Automated analysis of proliferating cells spatial organization predicts prognosis in lung neuroendocrine neoplasms, Cancers 2021

Installation

Install all packages with this command:

$ conda env create -f environment.yml

Datasets

This method has been tested for 2 types of immunostained WSI:

These two dataset are available on request from mathiane[at]iarc[dot]who[dot]int and will soon be available online.

Step 1: Tiles preprocessing

python preprocessin.py --inputdir PPH3Dataset/train256 --outputdir PPH3DatasetPrepocessed/train256

Step 2: Training

python train.py --configPath configs/train_Ki67_LNEN.json

Step 3: Test

python evaluation.py --inputPath test256_LNENonly --configPath configs/eval_Ki67_LNEN.json 

Step 4: Optimize the cell detection threshold

python eval_opt_thresholds.py --inputPath test256 --configPath configs/eval_Ki67_LNEN.json --dataname OptTh0_pos_cells.csv --minth 75 --minth 95 --channel 0

Step 5: Inference

python infer.py --inputPath KI67_Tiles_256_256_40x/ --configPath configs/eval_Ki67_LNEN.json --outputPath Inference --save_numpy --visualization

Step 6: Calculate spatial statistics:

Step 6.1: Create a table of detected cells within the tumour area

-In order to create the graph needed to compute the spatial statistics, we first need to create a table of detected cells within the tumour area, with their xy coordinates and class.

python table_of_cells_after_segmentation.py --inputdir ~/LNENWork/Ki67InferencePathonet --patient_id TNE1983 --segmentation_dir TumorSegmentation_Ki67
file_pathPredTumorNomal
KI67_Tiling_256_256_40x/TNE1983.svs/accept/TNE1983.svs_11777_28161.jpgTumor
KI67_Tiling_256_256_40x/TNE1983.svs/accept/TNE1983.svs_16385_7169.jpgTumor
KI67_Tiling_256_256_40x/TNE1983.svs/accept/TNE1983.svs_21505_10241.jpgTumor
KI67_Tiling_256_256_40x/TNE1983.svs/accept/TNE1983.svs_18945_21505.jpgNormal
xylabel
17659.56669.51
17637.7857208251956902.7857208251951
17616.06663.02

Note: In this table, the label 1 corresponds to a positive cell and 2 to a negative cell.

Step 6.2: Compute sptatial metrics according to graph theory

python graph_theory_analysis.py --rootdir /LNENWork/Ki67InferencePathonet --patient_id TNE1983