From 5b7e87cceb8cccd85fef44b113d9b6dd6fc869b4 Mon Sep 17 00:00:00 2001
From: Stamatios Sotiropoulos <stam@fmrib.ox.ac.uk>
Date: Sat, 14 Jul 2012 14:36:43 +0000
Subject: [PATCH] Remove the gradient-nonlin correction files if used

---
 bedpostx_postproc.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bedpostx_postproc.sh b/bedpostx_postproc.sh
index 8afaac7..14c79cc 100755
--- a/bedpostx_postproc.sh
+++ b/bedpostx_postproc.sh
@@ -57,6 +57,9 @@ if [ `imtest ${subjdir}.bedpostX/merged_th1samples` -eq 1 ];then
       rm -rf ${subjdir}.bedpostX/diff_slices
       rm -f ${subjdir}/data_slice_*
       rm -f ${subjdir}/nodif_brain_mask_slice_*
+      if [ `imtest ${subjdir}/grad_dev_slice_0000` -eq 1 ];then
+	  rm -f ${subjdir}/grad_dev_slice_*
+      fi	  
     fi
   fi
 fi
-- 
GitLab