Import the experimental virtual environment in conda
conda env -f mran.yaml
then enter the environment:
conda activate mran
Sample dataset download: Link 1 Link 2
After downloading, extract example.zip
to the MRAN/WSI/
directory, then preprocess the original image:
cd pre
python run_preprocess.py
The storage format of the original data set can refer to the sample data set in MRAN/WSI/example
:
MRAN/WSI/dataset_name/*/slide-idx1.svs
...
MRAN/WSI/dataset_name/*/slide-idxn.svs
Because the example dataset comes from TCGA, the first 12 bits of the file name slide_idxi.svs
of each image are its case id.
cd pre
python pro_csv.py
The format of the label file of the original dataset can refer to MRAN/csv/example/sheet/total.csv
:
File Name | Sample Type |
---|---|
slide-idxi.svs | Primary Tumor |
slide-idxj.svs | Solid Tissue Normal |
.... | ... |
python main.py
main.yaml
is used to set parameters.
python test.py
The predict.csv
of the directory "output_dir"
records the prediction results on the test set.
cd interpretability
python top_bag_top_patch.py
"output_dir"/tb_tp/*/predict.csv
records the prediction results on the test set.