forked from rgerraty/rl_flexibility
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake_brainmap.sh
More file actions
executable file
·40 lines (33 loc) · 937 Bytes
/
make_brainmap.sh
File metadata and controls
executable file
·40 lines (33 loc) · 937 Bytes
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
val_ind=$1
region_list=$2
val_list=$3
p=$4
if [ -z $3 ];
then
echo code for generating statistical maps from thresholded ROIs
echo need to specify list of ROIs, list of statistics, and indices of regions passing threshold
echo ~/GitHub/rl_flexibility/make_brainmap.sh p005_regions.txt HO_name_list.txt p_vals_learning_glm.csv
echo Raphael Gerraty 2016
else
k=1;
for i in $(cat $val_ind);
do
region=$(cat $region_list | awk -v roi=$i 'FNR==roi { print ;exit }');
val=$(cat $val_list | awk -v val=$i 'FNR==val { print;exit }');
echo $region $val
if [ "$p" == "p" ];
then
val="$(sed 's/[eE]+\{0,1\}/*10^/g' <<<"$val")"
val=$(echo 1 - $val | bc -l)
fi
if [ $k -eq 1 ];
then
fslmaths $region -mul $val $(basename $val_ind .txt)
else
fslmaths $region -mul $val roi_tmp
fslmaths $(basename $val_ind .txt).nii.gz -add roi_tmp.nii.gz $(basename $val_ind .txt)
fi
k=$(($k+1))
done
rm -rf roi_tmp.nii.gz
fi