-
Notifications
You must be signed in to change notification settings - Fork 0
/
signMaps
executable file
·45 lines (40 loc) · 1.89 KB
/
signMaps
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
#!/usr/bin/env bash
exec > >(tee -a ~/signMap_output.log)
exec 2> >(tee -a ~/signMap_error.log >&2)
while getopts s:t:d:m: flag
do
case "${flag}" in
s) dirSubs=${OPTARG};;
t) dirHCP=${OPTARG};;
d) datasetName=${OPTARG};;
?)
echo "script usage: $(basename "$0") [-s path to subs] [-t path to HCP surfaces] [-d name of the dataset]" >&2
exit 1
esac
done
echo "Path subs directory: $dirSubs";
echo "Path to fs_LR-deformed_to-fsaverage surfaces: $dirHCP";
echo "Dataset name: $datasetName";
for hemisphere in 'lh' 'rh';
do
echo "Generating visual field sign maps from fsaverage predicted maps..."
4_signmaps.py --path $dirSubs --hemisphere $hemisphere
echo "Resampling fsaverage sign maps to native space..."
cd $dirSubs
for dirSub in `ls $dirSubs`;
do
if [ "$hemisphere" == 'lh' ]; then
echo $dirSub
wb_command -metric-resample $dirSub/deepRetinotopy/"$dirSub".fs_predicted_fieldSignMap_"$hemisphere"_average.func.gii \
$dirHCP/fs_LR-deformed_to-fsaverage.L.sphere.32k_fs_LR.surf.gii \
$dirSub/surf/"$hemisphere".sphere.reg.surf.gii ADAP_BARY_AREA $dirSub/deepRetinotopy/"$dirSub".predicted_fieldSignMap_average."$hemisphere".native.func.gii \
-area-surfs $dirSub/surf/"$dirSub"."$hemisphere".midthickness.32k_fs_LR.surf.gii $dirSub/surf/"$hemisphere".midthickness.surf.gii
else
wb_command -metric-resample $dirSub/deepRetinotopy/"$dirSub".fs_predicted_fieldSignMap_"$hemisphere"_average.func.gii \
$dirHCP/fs_LR-deformed_to-fsaverage.R.sphere.32k_fs_LR.surf.gii \
$dirSub/surf/"$hemisphere".sphere.reg.surf.gii ADAP_BARY_AREA $dirSub/deepRetinotopy/"$dirSub".predicted_fieldSignMap_average."$hemisphere".native.func.gii \
-area-surfs $dirSub/surf/"$dirSub"."$hemisphere".midthickness.32k_fs_LR.surf.gii $dirSub/surf/"$hemisphere".midthickness.surf.gii
fi
done
done
echo "All done!"