Skip to content
Snippets Groups Projects
Commit 8b76e621 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'enh/new_bedpostx_wrapper' into 'main'

Adding a new wrapper for bedpostx

See merge request fsl/fslpy!454
parents d2c7cc1b 3a561fab
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,17 @@ This document contains the ``fslpy`` release history in reverse chronological ...@@ -2,6 +2,17 @@ This document contains the ``fslpy`` release history in reverse chronological
order. order.
3.19.0 (Under development)
--------------------------
Added
^^^^^
* New :func:`.bedpostx_postproc` wrapper function (!454).
3.18.3 (Saturday 4th May 2024) 3.18.3 (Saturday 4th May 2024)
------------------------------ ------------------------------
......
...@@ -578,6 +578,15 @@ def test_split_parts_gpu(): ...@@ -578,6 +578,15 @@ def test_split_parts_gpu():
assert res.stdout[0] == exp assert res.stdout[0] == exp
def test_bedpostx_postproc():
with testenv('bedpostx_postproc.sh') as bpg:
res = fw.bedpostx_postproc('data', 'mask', 'bvecs', 'bvals',
100, 10, 'subdir', 'bindir', nf=20)
exp = f'{bpg} --data=data --mask=mask --bvecs=bvecs --bvals=bvals ' \
'--nf=20 100 10 subdir bindir'
assert res.stdout[0] == exp
def test_bedpostx_postproc_gpu(): def test_bedpostx_postproc_gpu():
with testenv('bedpostx_postproc_gpu.sh') as bpg: with testenv('bedpostx_postproc_gpu.sh') as bpg:
res = fw.bedpostx_postproc_gpu('data', 'mask', 'bvecs', 'bvals', res = fw.bedpostx_postproc_gpu('data', 'mask', 'bvecs', 'bvals',
......
...@@ -166,6 +166,7 @@ from fsl.wrappers.bedpostx import (xfibres, ...@@ -166,6 +166,7 @@ from fsl.wrappers.bedpostx import (xfibres,
xfibres_gpu, xfibres_gpu,
split_parts_gpu, split_parts_gpu,
bedpostx_postproc_gpu, bedpostx_postproc_gpu,
bedpostx_postproc,
probtrackx, probtrackx,
probtrackx2, probtrackx2,
probtrackx2_gpu) probtrackx2_gpu)
......
...@@ -14,6 +14,7 @@ commands. ...@@ -14,6 +14,7 @@ commands.
xfibres xfibres
xfibres_gpu xfibres_gpu
split_parts_gpu split_parts_gpu
bedpostx_postproc
bedpostx_postproc_gpu bedpostx_postproc_gpu
probtrackx probtrackx
probtrackx2 probtrackx2
...@@ -160,6 +161,27 @@ def bedpostx_postproc_gpu(data, mask, bvecs, bvals, TotalNumVoxels, ...@@ -160,6 +161,27 @@ def bedpostx_postproc_gpu(data, mask, bvecs, bvals, TotalNumVoxels,
return cmd return cmd
@wutils.fileOrImage('data', 'mask',)
@wutils.fileOrArray('bvecs', 'bvals')
@wutils.fslwrapper
def bedpostx_postproc(data, mask, bvecs, bvals, TotalNumVoxels,
TotalNumParts, SubjectDir, bindir, **kwargs):
"""Wrapper for the ``bedpostx_postproc`` command."""
asrt.assertFileExists(data, bvecs, bvals)
asrt.assertIsNifti(mask)
cmd = ['bedpostx_postproc.sh',
'--data=' + data,
'--mask=' + mask,
'--bvecs=' + bvecs,
'--bvals=' + bvals]
cmd += wutils.applyArgStyle('--=', valmap=XFIBRES_VALMAP, **kwargs)
cmd += [str(TotalNumVoxels), str(TotalNumParts), SubjectDir, bindir]
return cmd
@wutils.fileOrImage('mask', 'seed') @wutils.fileOrImage('mask', 'seed')
@wutils.fslwrapper @wutils.fslwrapper
def probtrackx(samples, mask, seed, **kwargs): def probtrackx(samples, mask, seed, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment