This is not an official Verily product.
HIPI: Spatially Resolved Multiplexed Protein Expression Inferred from H&E WSIs
- Create conda environment:
conda env create -f environment.yml
- Install SimpleITK
- Download H&Es and CyCIF files from Lin et al. 2023
bash download_CRC_Lin23.sh
- Align H&Es and CyCIF images using the
preprocess/align_hne_cycif.shscript
bash align_hne_cycif.sh
- Extract image tiles using the
preprocess/split_hne_to_tiles.shscript
bash split_hne_to_tiles.sh
- Create a tile feature dataframe table using the
preprocess/create_tile_measurement_table.pyscript
python create_tile_measurement_table.py
All scripts use the current directory unless otherwise specified.
- Configuration files for model and training paramaters are in
configsfolder - To train HIPI with default parameters run the following (after adjusting the log dir and number of gpus):
python cycif_train_main.py --base configs/ssl_vit_mlp8_16channels.yaml --logdir logs -t --gpus 0,1,2,3,
Run the cycif_eval_main.py script with the model configuration and checkpoint to evaluate. You can choose which dataset to evaluate from the config file (train, validatiob, test) or overwrite in the command line.
python cycif_eval_main.py --cfg_file configs/ssl_vit_mlp8_16channels.yaml --ckpt_file "${ckpt_file}" --test_csv "${test_csv}" --num_workers 4 --out_path "${out_path}" --batch_size 512 --device cuda:0 --datasets "${dataset}"
Weights for the tranied model are in models/HIPI_model.ckpt

