Skip to content

Commit 38e73bc

Browse files
committed
add doctest for running eddy with s2v motion correction
1 parent 13dc42e commit 38e73bc

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

nipype/interfaces/fsl/epi.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ class EddyInputSpec(FSLCommandInputSpec):
727727
mporder = traits.Int(
728728
argstr='--mporder=%s',
729729
desc='Order of slice-to-vol movement model',
730+
requires=['use_cuda'],
730731
min_ver='5.0.11')
731732
s2v_niter = traits.Int(
732733
argstr='--s2v_niter=%s',
@@ -885,6 +886,8 @@ class Eddy(FSLCommand):
885886
--------
886887
887888
>>> from nipype.interfaces.fsl import Eddy
889+
890+
Running eddy on an Nvidia GPU using cuda:
888891
>>> eddy = Eddy()
889892
>>> eddy.inputs.in_file = 'epi.nii'
890893
>>> eddy.inputs.in_mask = 'epi_mask.nii'
@@ -899,14 +902,31 @@ class Eddy(FSLCommand):
899902
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
900903
--interp=spline --resamp=jac --niter=5 --nvoxhp=1000 \
901904
--out=.../eddy_corrected --slm=none'
905+
906+
Running eddy on a CPU using OpenMP:
902907
>>> eddy.inputs.use_cuda = False
903-
>>> eddy.cmdline # doctest: +ELLIPSIS
908+
>>> eddy.cmdline # doctest: +ELLIPSIS
904909
'eddy_openmp --flm=quadratic --ff=10.0 --fwhm=0.0 \
905910
--acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \
906911
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
907912
--interp=spline --resamp=jac --niter=5 --nvoxhp=1000 \
908913
--out=.../eddy_corrected --slm=none'
909-
>>> res = eddy.run() # doctest: +SKIP
914+
915+
Running eddy with slice-to-volume motion correction:
916+
>>> eddy.inputs.use_cuda = True
917+
>>> eddy.inputs.mporder = 6
918+
>>> eddy.inputs.s2v_niter = 5
919+
>>> eddy.inputs.s2v_lambda = 1
920+
>>> eddy.inputs.s2v_interp = 'trilinear'
921+
>>> eddy.inputs.slspec = 'epi_slspec.txt'
922+
>>> eddy.cmdline # doctest: +ELLIPSIS
923+
'eddy_cuda --flm=quadratic --ff=10.0 --fwhm=0.0 \
924+
--acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \
925+
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
926+
--interp=spline --resamp=jac --mporder=6 --niter=5 --nvoxhp=1000 \
927+
--out=.../eddy_corrected --s2v_interp=trilinear --s2v_niter=5 \
928+
--slm=none --slspec=epi_slspec.txt'
929+
>>> res = eddy.run() # doctest: +SKIP
910930
911931
"""
912932

nipype/interfaces/fsl/tests/test_auto_Eddy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def test_Eddy_inputs():
125125
mporder=dict(
126126
argstr='--mporder=%s',
127127
min_ver='5.0.11',
128+
requires=['use_cuda'],
128129
),
129130
niter=dict(
130131
argstr='--niter=%s',

nipype/testing/data/epi_slspec.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)