generated from dipy/bl_apps_dipy_fit_dti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain
executable file
·46 lines (41 loc) · 1.18 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
#PBS -l nodes=1:ppn=6
#PBS -l vmem=16gb
#PBS -l walltime=10:00:00
set -e
set -x
cmd=`jq -r .command config.json`
case "$cmd" in
dipy_fit_mapmri)
cat > script.sh <<EOF
#!/bin/bash
LAPLACIAN_OPT=`jq -r '.laplacian' config.json`
POSITIVITY_OPT=`jq -r '.positivity' config.json`
if [ "$LAPLACIAN_OPT" = true ]; then
LAPLACIAN_OPT="--laplacian"
else
LAPLACIAN_OPT=" "
fi
if [ "$POSITIVITY_OPT" = true ]; then
POSITIVITY_OPT="--positivity"
else
POSITIVITY_OPT=" "
fi
$cmd --force \
--out_dir $(pwd) \
--b0_threshold $(jq -r .b0_threshold config.json) \
$LAPLACIAN_OPT $POSITIVITY_OPT \
--bval_threshold $(jq -r .bval_threshold config.json) \
--laplacian_weighting $(jq -r .laplacian_weighting config.json) \
--radial_order $(jq -r .radial_order config.json) \
--out_strat what \
$(jq -r .dwi config.json) $(jq -r .bvals config.json) $(jq -r .bvecs config.json) $(jq -r .small_delta config.json) $(jq -r .big_delta config.json)
EOF
;;
*)
echo "invalid command: $cmd"
exit 1
esac
chmod +x script.sh
SINGULARITYENV_PYTHONNOUSERSITE=true singularity exec -e docker://brainlife/dipy:1.1.1 ./script.sh
echo "done"