diff --git a/EddyS2VTest/feedsRun b/EddyS2VTest/feedsRun index 2f3e2d5889110cfb8314300acaeb3b03e55b8f0e..49863ebd8dff9f091eb0de6ef62e1edadf918691 100755 --- a/EddyS2VTest/feedsRun +++ b/EddyS2VTest/feedsRun @@ -6,10 +6,8 @@ # Graham, UCL, which allows us to have a ground # truth. The data is a subset of that used # for the s2v paper. -# At the time of writing this (May, 2017) the openmp version -# is not able to do slice-to-vol realignment. Hence only -# the cuda version is tested. The script should be updated -# if/when there is an openmp implementation of slice-to-vol. +# The script was updated in May 2021 to test also the openmp +# version. # odir=$1 @@ -35,10 +33,10 @@ do exit 1 fi done -#if [ ! -x "${exedir}/eddy_openmp" ]; then -# echo "Executable ${exedir}/eddy_openmp does not exist" -# exit 1 -#fi +if [ ! -x "${exedir}/eddy_openmp" ]; then + echo "Executable ${exedir}/eddy_openmp does not exist" + exit 1 +fi if [ ! -d "$odir" ]; then echo "Output directory ${odir} does not exist" @@ -59,9 +57,9 @@ do cuda_jid="$cuda_jid `fsl_sub -l ${odir} -q cuda.q ${cuda_exe} --imain=${indir}/EddyS2VTestData/eddyData/testData --mask=${indir}/EddyS2VTestData/eddyData/testMask --bvals=${indir}/EddyS2VTestData/eddyData/testBvals --bvecs=${indir}/EddyS2VTestData/eddyData/testBvecs --index=${indir}/EddyS2VTestData/eddyData/testIndex --acqp=${indir}/EddyS2VTestData/eddyData/testAcqparams --repol --ol_type=slice --ol_nstd=6 --ol_nvox=500 --niter=8 --fwhm=10,6,4,2,0,0,0,0 --out=${odir}/eddyCudaOutput${version} --nvoxhp=5000 --mporder=16 --s2v_niter=10 --s2v_interp=trilinear --s2v_lambda=1 --slspec=${indir}/EddyS2VTestData/eddyData/testSlspec --very_verbose`" done -# omp_jid=`fsl_sub -q long.q -s openmp,6 ${exedir}/eddy_openmp --imain=${indir}/EddyS2VTestData/eddyData/testData --mask=${indir}/EddyS2VTestData/eddyData/testMask --bvals=${indir}/EddyS2VTestData/eddyData/testBvals --bvecs=${indir}/EddyS2VTestData/eddyData/testBvecs --index=${indir}/EddyS2VTestData/eddyData/testIndex --acqp=${indir}/EddyS2VTestData/eddyData/testAcqparams --repol --ol_type=slice --ol_nstd=6 --niter=8 --fwhm=10,6,4,2,0,0,0,0 --out=${odir}/eddyOmpOutput --nvoxhp=5000 --mporder=16 --s2v_niter=10 --s2v_interp=trilinear --s2v_lambda=1 --slspec=${indir}/EddyS2VTestData/eddyData/testSlspec --very_verbose` +omp_jid=`fsl_sub -l ${odir} -q long.q -s openmp,6 ${exedir}/eddy_openmp --imain=${indir}/EddyS2VTestData/eddyData/testData --mask=${indir}/EddyS2VTestData/eddyData/testMask --bvals=${indir}/EddyS2VTestData/eddyData/testBvals --bvecs=${indir}/EddyS2VTestData/eddyData/testBvecs --index=${indir}/EddyS2VTestData/eddyData/testIndex --acqp=${indir}/EddyS2VTestData/eddyData/testAcqparams --repol --ol_type=slice --ol_nstd=6 --niter=8 --fwhm=10,6,4,2,0,0,0,0 --out=${odir}/eddyOmpOutput --nvoxhp=5000 --mporder=16 --s2v_niter=10 --s2v_interp=trilinear --s2v_lambda=1 --slspec=${indir}/EddyS2VTestData/eddyData/testSlspec --very_verbose` # Ensure that slots are being reserved on the queue -# qalter ${omp_jid} -R y +qalter ${omp_jid} -R y # Wait until they have both finished @@ -75,15 +73,12 @@ while [ : ]; do fi done if [ $tmp -eq 0 ]; then - break + tmp=`qstat -j ${omp_jid} | wc` + tmp=`echo $tmp | awk '{print $1}'` + if [ $tmp -eq 0 ]; then + break + fi fi -# if [ $tmp -eq 0 ]; then -# tmp=`qstat -j ${omp_jid} | wc` -# tmp=`echo $tmp | awk '{print $1}'` -# if [ $tmp -eq 0 ]; then -# break -# fi -# fi sleep 5m done @@ -94,12 +89,14 @@ do tmp=`basename $cuda_exe` version=`echo $tmp | sed 's/eddy_cuda//'` if [ ! -f ${odir}/eddyCudaOutput${version}.nii* ]; then + echo "Cuda output eddyCudaOutput${version} missing" exit 1 fi done -#if [ ! -f ${odir}/eddyOmpOutput.nii* ]; then -# exit 1 -#fi +if [ ! -f ${odir}/eddyOmpOutput.nii* ]; then + echo "Omp output eddyOmpOutput missing" + exit 1 +fi # Define some constants # These are for the comparison of output images divided on b=0, b=700 and b=2000 @@ -127,6 +124,9 @@ utput${version}.eddy_outlier_map ${indir}/EddyS2VTestData/eddyData/OutlierTruth/ done omp_exit_status=0 +./S2VFeeds.py ${odir} Omp `imglob -extension ${indir}/EddyS2VTestData/eddyData/testMask` ${indir}/EddyS2VTestData/eddyData/testBvals `imglob -extension ${odir}/eddyOmpOutput` `imglob -extension ${indir}/EddyS2VTestData/eddyData/GroundTruth/ground_truth` ${odir}/eddyOmpOutput.eddy_movement_over_time ${indir}/EddyS2VTestData/eddyData/MovementTruth/ground_truth.eddy_movement_over_time ${odir}/eddyOmpOutput.eddy_outlier_map ${indir}/EddyS2VTestData/eddyData/OutlierTruth/dropoutLog_1.txt ${max_ima_diff} ${max_false_pos} ${max_false_neg} ${max_trans_diff} ${max_rot_diff} +omp_exit_status=$? + if [ $cuda_exit_status -gt 0 ] || [ $omp_exit_status -gt 0 ]; then echo "Test failed"