Skip to content
Snippets Groups Projects

BF: Correctly kill the background eddy process(es)

Merged Matthew Webster requested to merge bf/eddyControl into master
1 file
+ 7
2
Compare changes
  • Side-by-side
  • Inline
@@ -4,6 +4,8 @@
@@ -4,6 +4,8 @@
# Tests topup, eddy, and gps.
# Tests topup, eddy, and gps.
set -e
set -e
 
# -m needed for correct jobs control
 
set -m
set -x
set -x
outdir=$1
outdir=$1
@@ -40,15 +42,18 @@ if which eddy_openmp &> /dev/null; then
@@ -40,15 +42,18 @@ if which eddy_openmp &> /dev/null; then
--index=$subdatadir/index.txt --acqp=$subdatadir/acqparams.txt \
--index=$subdatadir/index.txt --acqp=$subdatadir/acqparams.txt \
--bvecs=$subdatadir/bvecs --bvals=$subdatadir/bvals \
--bvecs=$subdatadir/bvecs --bvals=$subdatadir/bvals \
--fwhm=0 --topup=$outdir/topup_AP_PA_b0 --flm=quadratic \
--fwhm=0 --topup=$outdir/topup_AP_PA_b0 --flm=quadratic \
--out=$outdir/eddy_unwarped_images & sleep 10; kill -s TERM $!
--out=$outdir/eddy_unwarped_images &
elif which eddy &> /dev/null; then
elif which eddy &> /dev/null; then
eddy --imain=$subdatadir/dwidata --mask=$outdir/hifi_nodif_brain_mask \
eddy --imain=$subdatadir/dwidata --mask=$outdir/hifi_nodif_brain_mask \
--index=$subdatadir/index.txt --acqp=$subdatadir/acqparams.txt \
--index=$subdatadir/index.txt --acqp=$subdatadir/acqparams.txt \
--bvecs=$subdatadir/bvecs --bvals=$subdatadir/bvals \
--bvecs=$subdatadir/bvecs --bvals=$subdatadir/bvals \
--fwhm=0 --topup=$outdir/topup_AP_PA_b0 --flm=quadratic \
--fwhm=0 --topup=$outdir/topup_AP_PA_b0 --flm=quadratic \
--out=$outdir/eddy_unwarped_image & sleep 10; kill -s TERM $!
--out=$outdir/eddy_unwarped_images &
fi
fi
 
sleep 10
 
kill %1
 
cp $subdatadir/pre_baked/eddy_unwarped_images* $outdir
cp $subdatadir/pre_baked/eddy_unwarped_images* $outdir
# Finally, test the gps command, for generating bvecs
# Finally, test the gps command, for generating bvecs
Loading