generated from dipy/bl_apps_dipy_mask
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main
executable file
·52 lines (41 loc) · 985 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#PBS -l nodes=1:ppn=8
#PBS -l vmem=16gb
#PBS -l walltime=10:00:00
export SINGULARITYENV_OMP_NUM_THREADS=7
set -e
set -x
mkdir -p output
cp $(jq -r .bvecs config.json) output/dwi.bvecs
cp $(jq -r .bvals config.json) output/dwi.bvals
chmod -R +w output
mkdir -p secondary
chmod -R +w secondary
AUTOCROP=$(jq -r .autocrop config.json)
if $AUTOCROP
then
AUTOCROP="--autocrop"
else
AUTOCROP=""
fi
DILATE=$(jq -r .dilate config.json)
if [[ $DILATE = null ]]
then
DILATE=""
else
DILATE="--dilate $DILATE"
fi
time singularity exec -e docker://brainlife/dipy:1.1.1 dipy_median_otsu \
--force \
--out_dir output \
--save_masked \
--median_radius $(jq -r .median_radius config.json) \
--numpass $(jq -r .numpass config.json) \
$AUTOCROP \
--vol_idx $(jq -r .vol_idx config.json) \
$DILATE \
--out_mask mask.nii.gz \
--out_masked dwi.nii.gz \
$(jq -r .dwi config.json)
mv output/mask.nii.gz secondary/
echo "done"