-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_patch_feats_split.sh
95 lines (83 loc) · 2.79 KB
/
run_patch_feats_split.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# TCGA wsi dataset
# datapath="/mnt/DATA/TCGA/TCGA-BRCA/harmonized/Biospecimen/SVSimage/"
# patchpath="/home/cyyan/Projects/HER2proj/results/TCGA_1WsiPatching_20x"
# featspath="/home/cyyan/Projects/HER2proj/results/TCGA_2FeatsCCL_20x"
# splitspath="/home/cyyan/Projects/HER2proj/results/TCGA_3CaseSplits"
# csvinfopath="/home/cyyan/Projects/HER2proj/data_TCGABRCA/TCGABRCA_AllSlides_ClinInfo_Status0927.csv"
# HEROHE biopsy dataset
# datapath="/mnt/DATA/HEROHE_challenge/TrainSet/"
# patchpath="/home/cyyan/Projects/HER2proj/results/HEROHE_train_1WsiPatching_40x"
# featspath="/home/cyyan/Projects/HER2proj/results/HEROHE_train_2FeatsCCL_40x_tumor"
# splitspath="/home/cyyan/Projects/HER2proj/results/HEROHE_3CaseSplits"
# csvinfopath="/mnt/DATA/HEROHE_challenge/HEROHE_TrainGTinfo.csv"
# Yale biopsy dataset
datapath="/home/cyyan/Projects/HER2proj/data_ModPath_HER2_v3/pkg_v3/Yale_HER2_cohort/SVS"
patchpath="/home/cyyan/Projects/HER2proj/results/Yale_1WsiPatching"
featspath="/home/cyyan/Projects/HER2proj/results/Yale_2FeatsCCL"
splitspath="/home/cyyan/Projects/HER2proj/results/Yale_3CaseSplits"
csvinfopath="/home/cyyan/Projects/HER2proj/data_ModPath_HER2_v3/Yale_HER2status.csv"
labelname="HER2status"
tocsvpath=$patchpath"/process_list_autogen.csv"
cclmodelpth="/home/cyyan/Projects/HER2proj/models/CCL_best_ckpt.pth" # CCL_best_ckpt.pth ctranspath.pth
if true; then
tile_size=256
overlap_size=256
echo "WsiPatching..."
python s1_WsiTiling.py \
-s $datapath \
-d $patchpath \
-ps $tile_size \
-ss $overlap_size \
--patch \
--bgtissue \
--stitch
fi
if true; then
echo "FeatsExtraction..."
python s2_FeatsExtracting.py \
--feat_to_dir $featspath \
--csv_path $tocsvpath \
--h5_dir $patchpath \
--retccl_filepath $cclmodelpth \
--slide_dir $datapath \
--slide_ext ".svs" \
--batch_size 320 \
--float16
fi
# --auto_skip \
#--gaussian_blur \
if true; then
echo "Cross Validation splitting ..."
echo "N times K folds cross validation mode split."
python s3_CaseSplitting.py \
--task_name "her2status" \
--csv_info_path $csvinfopath \
--split_to_dir $splitspath \
--times 5 \
--kfold 5 \
--val_frac 0 \
--test_frac 0.2 \
--label_column_name $labelname \
--label_list "Negative" "Positive" \
--slide_featspath $featspath\
--seed 2020
fi
if true; then
echo "N times train-val-test mode split."
python s3_CaseSplitting.py \
--task_name "her2status" \
--csv_info_path $csvinfopath \
--split_to_dir $splitspath \
--times 5 \
--kfold 0 \
--val_frac 0.1 \
--test_frac 0.2 \
--label_column_name $labelname \
--label_list "Negative" "Positive" \
--slide_featspath $featspath\
--seed 2020
fi
if true; then
echo "HP cluster for prototypes."
python s4_HPcluster_prototypes.py --config_file "cfg/Yale.yaml"
fi