-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathexample_run_maTT2.sh
executable file
·91 lines (72 loc) · 3.03 KB
/
example_run_maTT2.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
####################################################################
####################################################################
# SETUP FSL HERE (however it is done on your system)
# export FSLDIR=/programs/fsl/
# source ${FSLDIR}/etc/fslconf/fsl.sh
# SETUP FREESUFER HERE (however it is done on your system)
# module load freesurfer/5.3.0
####################################################################
####################################################################
# for maTT2 to function, download the .gcs files from:
# https://doi.org/10.6084/m9.figshare.5998583
# or here:
# https://doi.org/10.6084/m9.figshare.7552853
# and put these files into the
# /atlas_data/{atlas}/ folders that correspond to
# the atlasBaseDir variable set here
export atlasBaseDir=${PWD}/atlas_data/
# this is just the location where these scripts live
# ... needed so that the ${scriptBaseDir}/src can
# be found
export scriptBaseDir=${PWD}/
# make a list from these options:
# aal aicha arslan baldassano gordon333dil hcp-mmp-b ica nspn500 power
# schaefer100-yeo17 schaefer200-yeo17 schaefer300-yeo17 schaefer400-yeo17
# schaefer500-yeo17 shen268cort yeo17dil
#
# for example, for the schaefer 100, 200 and yeo-114 parcellation
# the line would be -->
export atlasList="schaefer100-yeo17 schaefer200-yeo17 yeo17dil"
# if you have a specific instal of python that you'd like to
# point this script to (for example, if you have your own
# python install on a supercomputer account), uncomment
# this line and set the variable 'py_bin' to that location
# export py_bin=/custom/path/to/your/python
####################################################################
####################################################################
# subject variables
subj="my_subject"
inputFSDir="/path/to/freesurfer/${subj}/"
outputDir="/output/to/somwhere/${subj}/"
mkdir -p ${outputDir} || \
{ echo "could not make dir" ; exit 0 ; } # safe-ish mkdir
####################################################################
####################################################################
# go into the folder where we also want output and setup notes file!
cd ${outputDir} || { echo "could not cd" ; exit 0 ; } # safe-ish cd
OUT="maTT2_notes.txt"
touch $OUT
####################################################################
####################################################################
# run the script
# script inputs:
# -d inputFSDir --> input freesurfer directory
# -o outputDir ---> output directory, will also write temporary
# -f fsVersion ---> freeSurfer version (5p3 or 6p0 and 7p1)
# -s doStats -----> flag for doing stats on parcellation; takes a while
# but gives you information about vol and coordinate
# start the timer!
start=`date +%s`
# run it
cmd="${scriptBaseDir}/src/maTT2_applyGCS.sh \
-d ${inputFSDir} \
-o ${outputDir} \
-f 6p0 \
"
echo $cmd
eval $cmd | tee -a ${OUT}
# record how long that took!
end=`date +%s`
runtime=$((end-start))
echo "runtime: $runtime"