-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathrun.sh
More file actions
121 lines (104 loc) · 2.46 KB
/
Copy pathrun.sh
File metadata and controls
121 lines (104 loc) · 2.46 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
# RUN FILE FOR AUTOMORPH
# YUKUN ZHOU 2023-08-24
# Updated: 2025-06-21
date
# ----------------------------- #
# Parse optional arguments
# ----------------------------- #
NO_PROCESS=0
NO_QUALITY=0
NO_SEGMENTATION=0
NO_FEATURE=0
for arg in "$@"; do
case $arg in
--no_process)
NO_PROCESS=1
shift
;;
--no_quality)
NO_QUALITY=1
shift
;;
--no_segmentation)
NO_SEGMENTATION=1
shift
;;
--no_feature)
NO_FEATURE=1
shift
;;
esac
done
# ----------------------------- #
# Step 0 - Prepare AUTOMORPH_DATA directory and clean up results
# ----------------------------- #
python automorph_data.py
if [ -z "${AUTOMORPH_DATA}" ]; then
rm -rf ./Results/*
echo "AUTOMORPH_DATA not set, using default directory"
else
rm -rf "${AUTOMORPH_DATA}/Results"/*
echo "AUTOMORPH_DATA set to ${AUTOMORPH_DATA}"
fi
# ----------------------------- #
# Step 1 - Image Preprocessing
# ----------------------------- #
if [ $NO_PROCESS -eq 0 ]; then
echo "### Preprocess Start ###"
cd M0_Preprocess
python EyeQ_process_main.py
cd ..
else
echo "### Skipping Preprocessing ###"
fi
# ----------------------------- #
# Step 2 - Image Quality Assessment
# ----------------------------- #
if [ $NO_QUALITY -eq 0 ]; then
echo "### Image Quality Assessment ###"
cd M1_Retinal_Image_quality_EyePACS
sh test_outside.sh
python merge_quality_assessment.py
cd ..
else
echo "### Skipping Image Quality Assessment ###"
fi
# ----------------------------- #
# Step 3 - Segmentation Modules
# ----------------------------- #
if [ $NO_SEGMENTATION -eq 0 ]; then
echo "### Segmentation Modules ###"
cd M2_Vessel_seg
sh test_outside.sh
cd ..
cd M2_Artery_vein
sh test_outside.sh
cd ..
cd M2_lwnet_disc_cup
sh test_outside.sh
cd ..
else
echo "### Skipping Segmentation Modules ###"
fi
# ----------------------------- #
# Step 4 - Feature Measurement
# ----------------------------- #
if [ $NO_FEATURE -eq 0 ]; then
echo "### Feature Measuring ###"
cd M3_feature_zone/retipy/
python create_datasets_disc_centred_B.py
python create_datasets_disc_centred_C.py
python create_datasets_macular_centred_B.py
python create_datasets_macular_centred_C.py
cd ../..
cd M3_feature_whole_pic/retipy/
python create_datasets_macular_centred.py
python create_datasets_disc_centred.py
cd ../..
python csv_merge.py
else
echo "### Skipping Feature Measurement ###"
fi
echo "### Done ###"
date