-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain
executable file
·50 lines (30 loc) · 1.28 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
47
48
49
50
#!/bin/bash
#PBS -l nodes=1:ppn=1
#PBS -l walltime=00:30:00
#parse config.json for input parameters
t1=$(jq -r .t1 config.json)
mask=$(jq -r .mask config.json)
computed=$(jq -r .computed config.json)
groud_truth=$(jq -r .groud_truth config.json)
if ! ( [ -z "${t1}" ] || [ "${t1}" == "null" ] ); then
echo "t1: "${t1}
echo "mask: "${mask}
outputdir=${PWD}"/segmentation"
mkdir -p ${outputdir}
output=${outputdir}'/segmentation.nii.gz'
proc_dir=${PWD}"/proc/"
mkdir -p ${proc_dir}
reference='./data/IMAGE_0426.nii.gz'
t1_hm=${proc_dir}'/t1_hm.nii.gz'
singularity exec -e docker://brainlife/ants:2.2.0-1bc ImageMath 3 ${t1_hm} HistogramMatch ${t1} ${reference}
chkcp_dir=${PWD}
singularity exec -e --nv docker://gamorosino/bl_app_dbb_disseg python predict.py ${t1_hm} ${output} ${chkcp_dir} --mask ${mask}
cp './data/label.json' ${outputdir}
elif ! ( [ -z "${computed}" ] || [ "${computed}" == "null" ] || [ -z "${groud_truth}" ] || [ "${groud_truth}" == "null" ] ); then
echo "computed: "${computed}
echo "groud_truth: "${groud_truth}
outputdir=${PWD}"/dice_score"
mkdir -p ${outputdir}
output=${outputdir}'/dice_score.txt'
singularity exec -e --nv docker://gamorosino/bl_app_dbb_disseg python dice_score.py ${computed} ${groud_truth} ${output}
fi