-
Notifications
You must be signed in to change notification settings - Fork 0
/
ebbrt_recon.sh
executable file
·47 lines (37 loc) · 1.04 KB
/
ebbrt_recon.sh
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
#!/bin/bash
export RECON_DIR=${PWD}/ext/EbbRT-fetalRecon
export RECONCMD=${RECON_DIR}/build/reconstruction
tranid=$1
threads=$(($2+1))
iterations=$3
backends=$4
mask=$5
frontEndCpus=$(($backends+1))
uploads="./uploads"
trandir="./transactions/${tranid}"
export EBBRT_NODE_ALLOCATOR_DEFAULT_CPUS=$threads
export EBBRT_NODE_ALLOCATOR_DEFAULT_RAM=4
export EBBRT_NODE_ALLOCATOR_DEFAULT_NUMANODES=1
function doRecon() {
mkdir -p ${trandir}/slices ${trandir}/mask
mv ${uploads}/* ${trandir}/slices
if [ -z "${mask}" ]
then
MASK=""
else
mv ${uploads}/${mask} ${trandir}/mask/
MASK="-m ${trandir}/mask/${mask}"
fi
cmd="${RECONCMD} -o ${trandir}/${tranid}.nii \
-i ${trandir}/slices/*.nii \
${MASK} \
--disableBiasCorrection --useAutoTemplate --useSINCPSF --resolution 2.0 \
--debug 1 \
--numThreads $threads --useCPU \
--iterations $iterations --numNodes $backends \
--numFrontEndCpus ${frontEndCpus}"
echo ${cmd}
$cmd
cp ${trandir}/${tranid}.nii public/recon/
}
doRecon;