-
Notifications
You must be signed in to change notification settings - Fork 9
/
run.sh
executable file
·68 lines (60 loc) · 2.08 KB
/
run.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
61
62
63
64
65
66
#!/bin/bash
echo "reading command line args"
inT1w="null"
inT2w="null"
inFMRI="null"
inFSDIR="null"
inODIR="null"
inWDIR="null"
while [ "$1" != "" ]; do
case $1 in
-t1 | -t1w ) shift
inT1w=$1
checkisfile $1
;;
-t2 | -t2w ) shift
inT2w=$1
checkisfile $1
;;
-fmri | -func ) shift
inFMRI=$1
checkisfile $1
;;
-fs | -freesurfer ) shift
inFSDIR=$1
checkisdir $1
;;
-inodir ) shift
inODIR=$1
checkisdir $1
;;
-inwdir ) shift
inWDIR=$1
checkisdir $1
;;
-img | -sing ) shift
CMDLINESINGIMG=$1
checkisfile $1
;;
-testscript ) # no shift needed here
TESTINGSCRIPT="true"
;;
-testrun ) # no shift needed here
TESTINGRUN="true"
;;
-h | --help ) echo "see script"
exit 1
;;
* ) echo "see script"
exit 1
esac
shift
done
#TODO - construct config.json from input parameters given
#brainlife expects $FREESURFER_LICENSE to be set to the content of license.txt (in a single line)
#TODO - not tested
if [[ -n $FREESURFER_HOME ]] ; then
export FREESURFER_LICENSE=$(cat $FREESURFER_HOME/license.txt)
fi
#finally run ./main for brainlife
./main