From 2f856c75720607c2e4b8bea3cc4f6cbd7f3a0114 Mon Sep 17 00:00:00 2001
From: Paul McCarthy <pauldmccarthy@gmail.com>
Date: Fri, 22 Oct 2021 12:47:32 +0100
Subject: [PATCH] TEST: Ported runme_gpu scripts to feedsRun equivalents

---
 gpu_test/btest/feedsRun | 10 ++++++++++
 gpu_test/etest/feedsRun | 39 +++++++++++++++++++++++++++++++++++++++
 gpu_test/ptest/feedsRun | 16 ++++++++++++++++
 3 files changed, 65 insertions(+)
 create mode 100644 gpu_test/btest/feedsRun
 create mode 100644 gpu_test/etest/feedsRun
 create mode 100644 gpu_test/ptest/feedsRun

diff --git a/gpu_test/btest/feedsRun b/gpu_test/btest/feedsRun
new file mode 100644
index 0000000..764cca0
--- /dev/null
+++ b/gpu_test/btest/feedsRun
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+set -e
+
+outdir=$1
+indir=$(pwd)
+
+pushd $outdir
+
+bedpostx_gpu $indir/bedpost
\ No newline at end of file
diff --git a/gpu_test/etest/feedsRun b/gpu_test/etest/feedsRun
new file mode 100644
index 0000000..8a3c2c4
--- /dev/null
+++ b/gpu_test/etest/feedsRun
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+
+set -e
+
+outdir=$1
+indir=$(pwd)
+
+pushd ${outdir}
+
+dti=${indir}/DTIap
+dti_bvec=${indir}/DTIap.bvec
+dti_bval=${indir}/DTIap.bval
+dti_b=${outdir}/DTIapb #brain-extracted dti
+dti_b0=${outdir}/DTIapb0
+dti_u=${outdir}/DTIapu #undistorted dti
+dti_b=${outdir}/DTIapb_mask #masked brain-extracted dti
+dti_txt=${outdir}DTIap_acq_param.txt
+dti_txt2=${outdir}/DTIap_index.txt
+
+#create acq_param: dummies as we will not run TOPUP
+printf "0 1 0 0.03388\n0 -1 0 0.03388\n" > $dti_txt
+
+#create index files: all = 1 as we will not run TOPUP
+nvol=$(fslnvols $dti)
+indx=""
+for ((i=1; i<=nvol; i+=1)); do indx="$indx 1"; done
+echo $indx > $dti_txt2
+
+fslroi $dti $dti_b0 0 1
+bet $dti_b0 $dti_b -f 0.2 -R -n -m
+
+eddy \
+  --imain=$dti                  \
+  --mask=$dti_b --acqp=$dti_txt \
+  --index=$dti_txt2             \
+  --bvecs=$dti_bvec             \
+  --bvals=$dti_bval             \
+  --repol                       \
+  --out=$dti_u
diff --git a/gpu_test/ptest/feedsRun b/gpu_test/ptest/feedsRun
new file mode 100644
index 0000000..2b413e7
--- /dev/null
+++ b/gpu_test/ptest/feedsRun
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+
+set -e
+
+outdir=$1
+indir=$(pwd)
+
+pushd $outdir
+
+for i in {1..172}; do
+   probtrackx2_gpu -x $indir/masks/$i.nii.gz       \
+     --dir=$indir/probtrackx/$i --forcedir  -P 200 \
+     -s $indir/bedpost.bedpostX/merged             \
+     -m $indir/bedpost.bedpostX/nodif_brain_mask   \
+     --opd --pd -l -c 0.2 --distthresh=0"
+done
-- 
GitLab