From 27f7fafa521fac42a7356be4e56c430468610093 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Mon, 19 Nov 2018 17:40:59 +0000
Subject: [PATCH] bedpostx tests

---
 README                                  |  6 +++++-
 fsl_course/fdt/bedpostx_cpu/feedsInputs |  1 +
 fsl_course/fdt/bedpostx_cpu/feedsRun    | 23 +++++++++++++++++++++++
 fsl_course/fdt/bedpostx_gpu/feedsInputs |  1 +
 fsl_course/fdt/bedpostx_gpu/feedsRun    | 18 ++++++++++++++++++
 5 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 fsl_course/fdt/bedpostx_cpu/feedsInputs
 create mode 100755 fsl_course/fdt/bedpostx_cpu/feedsRun
 create mode 100644 fsl_course/fdt/bedpostx_gpu/feedsInputs
 create mode 100755 fsl_course/fdt/bedpostx_gpu/feedsRun

diff --git a/README b/README
index c4ded7a..29b53c7 100644
--- a/README
+++ b/README
@@ -8,4 +8,8 @@ Run the tests from the repository root as follows:
     pyfeeds -c pyfeeds_config.cfg -o /path/to/output_direcfory .
 
 Before running the tests, make sure to update the paths in
-`pyfeeds_config.cfg`.
\ No newline at end of file
+`pyfeeds_config.cfg`.
+
+
+Note that some tests (e.g. `fsl_course/fdt/bedpostx_gpu/`) need to be run on a
+CUDA-capable machine.
\ No newline at end of file
diff --git a/fsl_course/fdt/bedpostx_cpu/feedsInputs b/fsl_course/fdt/bedpostx_cpu/feedsInputs
new file mode 100644
index 0000000..12c24c1
--- /dev/null
+++ b/fsl_course/fdt/bedpostx_cpu/feedsInputs
@@ -0,0 +1 @@
+fsl_course_data/fdt2/subj1
diff --git a/fsl_course/fdt/bedpostx_cpu/feedsRun b/fsl_course/fdt/bedpostx_cpu/feedsRun
new file mode 100755
index 0000000..7108e45
--- /dev/null
+++ b/fsl_course/fdt/bedpostx_cpu/feedsRun
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -e
+
+unset SGE_ROOT
+
+outdir=$1
+datadir=$2
+
+basedir=$datadir/fsl_course_data/fdt2/subj1
+
+# make a cut-down data set,
+# with just one slice
+mkdir  $outdir/subj1
+cp     $basedir/bvals            $outdir/subj1/
+cp     $basedir/bvecs            $outdir/subj1/
+fslroi $basedir/data             $outdir/subj1/data             0 -1 0 -1 31 1
+fslroi $basedir/nodif_brain_mask $outdir/subj1/nodif_brain_mask 0 -1 0 -1 31 1
+
+bedpostx $outdir/subj1 --nf=2 --fudge=1  --bi=1000 --seed=1234
+
+chmod -R u+w $outdir/subj1
+rm -r        $outdir/subj1
diff --git a/fsl_course/fdt/bedpostx_gpu/feedsInputs b/fsl_course/fdt/bedpostx_gpu/feedsInputs
new file mode 100644
index 0000000..12c24c1
--- /dev/null
+++ b/fsl_course/fdt/bedpostx_gpu/feedsInputs
@@ -0,0 +1 @@
+fsl_course_data/fdt2/subj1
diff --git a/fsl_course/fdt/bedpostx_gpu/feedsRun b/fsl_course/fdt/bedpostx_gpu/feedsRun
new file mode 100755
index 0000000..2c1b1e6
--- /dev/null
+++ b/fsl_course/fdt/bedpostx_gpu/feedsRun
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# This test needs to be executed
+# on a CUDA-capable machine
+
+set -e
+
+unset SGE_ROOT
+
+outdir=$1
+datadir=$2
+
+cp -r $datadir/fsl_course_data/fdt2/subj1 $outdir/
+
+bedpostx_gpu $outdir/subj1 --nf=2 --fudge=1  --bi=1000 --seed=1234
+
+chmod -R u+w $outdir/subj1
+rm -r        $outdir/subj1
-- 
GitLab