-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain
executable file
·32 lines (26 loc) · 1.01 KB
/
main
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
#!/bin/bash
#PBS -l nodes=1:ppn=8,vmem=15gb,walltime=60:00:00
#PBS -N ensembletracking
#PBS -V
#make the script to fail if any of the commands ran fails.
set -e
#validate some input parameters
if [ $(jq -r '.num_or_fibers' config.json) -gt 25 ]; then
echo "num_or_fibers should be less than 25"
exit 1
fi
if [ ! -f convertfiles.success ]; then
echo "converting aparc+aseg.mgz"
[ -z "$FREESURFER_LICENSE" ] && echo "Please set FREESURFER_LICENSE in .bashrc" && exit 1;
echo $FREESURFER_LICENSE > license.txt
#export SINGULARITYENV_FS_LICENSE=`pwd`/license.txt
time singularity exec -e -B `pwd`/license.txt:/usr/local/freesurfer/license.txt docker://brainlife/freesurfer:6.0.0 ./convertfiles.sh
fi
if [ ! -f wmmask.success ]; then
echo "creating exclude ROI with FSL"
time singularity exec -e docker://brainlife/fsl:5.0.9 ./make_fsl_roi.sh
fi
if [ ! -f track.tck ]; then
echo "running ensembetracking"
time singularity exec -e docker://brainlife/mrtrix:0.2.12 ./ensembletracking.sh
fi