-
Notifications
You must be signed in to change notification settings - Fork 7
/
1_enigma_runfreesurfer.sh
executable file
·58 lines (43 loc) · 1.3 KB
/
1_enigma_runfreesurfer.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
#!/bin/bash
#####
# 10/23/15
# Wrapper written by Eric Kan ([email protected])
#
# Script assumes the following structure
# Project_parent_directory/
# -> inputs/
# -> subj01 (contains nii input named subj01.nii(.gz))
# -> subj02
# ...
# -> outputs/
# -> subj01(freesurfer outputs)
# -> subj02
# ...
# -> enigma_wrapscripts/ (copied from elsewhere)
#
#
######
subject=$1
enigmadir=$2
if [ -z ${subject} ]; then
echo "Subject number must be specified"
echo "Usage is: ./1_enigma_runfreesurfer.sh <subject number> <parent directory of project>"
exit
fi
if [ -z ${enigmadir} ]; then
echo "Parent directory of 'inputs' folder must be specified"
echo "Usage is: ./1_enigma_runfreesurfer.sh <subject number> <parent directory of project>"
exit
fi
if [ $# -gt 2 ] ; then
echo "Too many arguments specified"
echo "Usage is: ./1_enigma_runfreesurfer.sh <subject number> <parent directory of project>"
exit
fi
if [ ! -e ${enigmadir} ] || [ ! -e ${enigmadir}/inputs/${subject}/${subject}.nii.gz ]; then
echo "Input directory or subject does not exist! Please check"
exit
fi
################
# recon-all loop
${enigmadir}/enigma_wrapscripts/bash/recon-all.sh -i ${enigmadir}/inputs/${subject}/${subject}.nii.gz -subjid ${subject} -sd ${enigmadir}/outputs -all