-
Notifications
You must be signed in to change notification settings - Fork 5
/
main
executable file
·33 lines (25 loc) · 954 Bytes
/
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
33
#!/bin/bash
#PBS -l nodes=1:ppn=4,vmem=28gb,walltime=10:00:00
#PBS -N wmaSeg
rm -rf tracts
[ -z "$FREESURFER_LICENSE" ] && echo "Please set FREESURFER_LICENSE in .bashrc" && exit 1;
echo $FREESURFER_LICENSE > license.txt
set -e
set -x
if [ ! -f aparc+aseg.nii.gz ]; then
echo "converting aparc.a2009+aseg file to nifti"
singularity exec -e -B `pwd`/license.txt:/usr/local/freesurfer/license.txt \
docker://brainlife/freesurfer-mini:6.0.1 ./convertaseg.sh
fi
echo "running segmentation"
singularity exec -e docker://brainlife/mcr:r2019a ./compiled/main
if [ ! -s classification/classification.mat ]; then
echo "output missing"
exit 1
fi
#TODO - will be deprecated soon by wmc datatype validator
echo "Generating surfaces/ vtk from aparc+aseg.mgz"
time singularity exec -e docker://brainlife/pythonvtk:1.1 ./freesurfer2vtks.py
#cp labels.json classification
#cp aparc.a2009s+aseg.nii.gz classification/parc.nii.gz
echo "all done"