-
Download and unzip the CoNSeP dataset to the directory
../MCSpatNet_datasetswget https://warwick.ac.uk/fac/cross_fac/tia/data/hovernet/consep.zip -P ../MCSpatNet_datasets unzip ../datasets/consep.zip -d ../MCSpatNet_datasets -
cd data_prepare/ -
Edit
1_generate_dot_maps_consep.py
Set the variables:
in_dirpoints to the CoNSeP train/test directory, and
out_root_dirpoints to the training/testing data output directory, respectively.
Default values are:in_dir = '../../MCSpatNet_datasets/CoNSeP/Train' out_root_dir = '../../MCSpatNet_datasets/CoNSeP_train' -
Run
1_generate_dot_maps_consep.pypython 1_generate_dot_maps_consep.pyIt will create 2 sub-directories:
imagesandgt_customin the output folder.
The generated files are:- images/:
<img_name>.png: the rescaled images by 0.5 (20x).
- gt_custom/:
<img_name>_gt_dots.npy: the classification dot annotation map.<img_name>_gt_dots_all.npy: the detection dot annotation map.<img_name>.npy: the classification binary mask.<img_name>_all.npy: the detection binary mask.<img_name>_s<class id>_binary.png: visualization of the binary mask for each class (default: 1=inflammatory, 2=epithelial, 3=stromal).<img_name>_binary.png: visualization of the detection binary mask.<img_name>_img_with_dots.jpg: image with cells dot annotation visualization with different dot colors. (default: blue=inflammatory, red=epithelial, green=stromal).
- images/:
-
Edit
2_calc_kmaps.py
Set the variables:
root_dirpoints to the CoNSeP train/test directory created in the previous step
Default value is:root_dir = '../../MCSpatNet_datasets/CoNSeP_train' -
Run
2_calc_kmaps.pypython 2_calc_kmaps.pyIt will create the sub-directory:
k_func_mapsin the output folder.
It generates the cross k function maps. The file names arek_func_maps/<img_name>_gt_kmap.npy -
Repeat steps 3-6 with the test data directory:
ReplaceCoNSeP/TrainwithCoNSeP/Test
ReplaceCoNSeP_trainwithCoNSeP_test