-
Notifications
You must be signed in to change notification settings - Fork 0
/
deepRetinotopy
executable file
·49 lines (42 loc) · 1.46 KB
/
deepRetinotopy
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
#!/usr/bin/env bash
exec > >(tee -a ~/deepRetinotopy_output.log)
exec 2> >(tee -a ~/deepRetinotopy_error.log >&2)
while getopts s:t:d:m: flag
do
case "${flag}" in
s) dirSubs=${OPTARG};;
t) dirHCP=${OPTARG};;
d) datasetName=${OPTARG};;
m) IFS=',' read -ra maps <<< "${OPTARG}";;
?)
echo "script usage: $(basename "$0") [-s path to subs] [-t path to HCP surfaces] [-d name of the dataset] [-m list of maps]" >&2
exit 1
esac
done
echo "Path subs directory: $dirSubs";
echo "Path to fs_LR-deformed_to-fsaverage surfaces: $dirHCP";
echo "Dataset name: $datasetName";
echo "Maps: ${maps[@]}";
for hemisphere in 'lh' 'rh';
do
echo "Generating mid-thickness surface and curvature data..."
1_native2fsaverage.sh -s $dirSubs -t $dirHCP -h $hemisphere
if [ $? -eq 1 ]; then
echo "Error in 1_native2fsaverage.sh"
exit 1
else
for map in "${maps[@]}";
do
echo "Retinotopy prediction..."
2_inference.py --path $dirSubs --dataset $datasetName --prediction_type $map --hemisphere $hemisphere
rm -r $dirSubs/processed
echo "Resampling predictions to native space..."
for model in model1 model2 model3 model4 model5 average;
do
3_fsaverage2native.sh -s $dirSubs -t $dirHCP -h $hemisphere -r $map -m $model
done
echo "$map predictions for $hemisphere are done!"
done
fi
done
echo "All done!"