-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmy_fba_response.sh
executable file
·63 lines (45 loc) · 1.04 KB
/
my_fba_response.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
#!/bin/bash
echo " [INFO] Running on `hostname`"
source `which my_do_cmd`
if [ "$#" -lt 1 ]
then
echo " [ERROR]. Insufficient arguments."
echo " Usage: `basename $0` subj"
echo ""
echo " This script is part of the set of scripts required for fixel-based analyses."
echo " See my_fba.sh for help."
exit 2
fi
subj=$1
mask=${FBA_DIR}/${subj}/mask.mif
dwis=${FBA_DIR}/${subj}/dwis_std.mif
wm_response=${FBA_DIR}/${subj}/wm_response.txt
gm_response=${FBA_DIR}/${subj}/gm_response.txt
csf_response=${FBA_DIR}/${subj}/csf_response.txt
isOK=1
for f in $dwis $mask
do
if [ ! -f $f ]
then
echo " [ERROR] Cannot find file: $f"
isOK=0
else
echo " [INFO] found file: $f"
fi
done
if [ $isOK -eq 0 ]
then
echo "THINGS ARE NOT OK"
exit 2
fi
if [ -f $wm_response ]
then
echo " [INFO] Response function exists: $wm_response"
exit 0
fi
my_do_cmd dwi2response dhollander \
-scratch /tmp \
-mask $mask \
-voxels ${FBA_DIR}/${subj}/sf_final_mask.mif \
$dwis \
$wm_response $gm_response $csf_response