Skip to content

Commit f30164d

Browse files
committed
add doctest for running eddy with s2v motion correction
1 parent e5fb64e commit f30164d

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
@@ -693,6 +693,7 @@ class EddyInputSpec(FSLCommandInputSpec):
693693
mporder = traits.Int(
694694
argstr='--mporder=%s',
695695
desc='Order of slice-to-vol movement model',
696+
requires=['use_cuda'],
696697
min_ver='5.0.11')
697698
s2v_niter = traits.Int(
698699
argstr='--s2v_niter=%s',
@@ -843,6 +844,8 @@ class Eddy(FSLCommand):
843844
--------
844845
845846
>>> from nipype.interfaces.fsl import Eddy
847+
848+
Running eddy on an Nvidia GPU using cuda:
846849
>>> eddy = Eddy()
847850
>>> eddy.inputs.in_file = 'epi.nii'
848851
>>> eddy.inputs.in_mask = 'epi_mask.nii'
@@ -857,14 +860,31 @@ class Eddy(FSLCommand):
857860
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
858861
--interp=spline --resamp=jac --niter=5 --nvoxhp=1000 \
859862
--out=.../eddy_corrected --slm=none'
863+
864+
Running eddy on a CPU using OpenMP:
860865
>>> eddy.inputs.use_cuda = False
861-
>>> eddy.cmdline # doctest: +ELLIPSIS
866+
>>> eddy.cmdline # doctest: +ELLIPSIS
862867
'eddy_openmp --flm=quadratic --ff=10.0 --fwhm=0.0 \
863868
--acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \
864869
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
865870
--interp=spline --resamp=jac --niter=5 --nvoxhp=1000 \
866871
--out=.../eddy_corrected --slm=none'
867-
>>> res = eddy.run() # doctest: +SKIP
872+
873+
Running eddy with slice-to-volume motion correction:
874+
>>> eddy.inputs.use_cuda = True
875+
>>> eddy.inputs.mporder = 6
876+
>>> eddy.inputs.s2v_niter = 5
877+
>>> eddy.inputs.s2v_lambda = 1
878+
>>> eddy.inputs.s2v_interp = 'trilinear'
879+
>>> eddy.inputs.slspec = 'epi_slspec.txt'
880+
>>> eddy.cmdline # doctest: +ELLIPSIS
881+
'eddy_cuda --flm=quadratic --ff=10.0 --fwhm=0.0 \
882+
--acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \
883+
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
884+
--interp=spline --resamp=jac --mporder=6 --niter=5 --nvoxhp=1000 \
885+
--out=.../eddy_corrected --s2v_interp=trilinear --s2v_niter=5 \
886+
--slm=none --slspec=epi_slspec.txt'
887+
>>> res = eddy.run() # doctest: +SKIP
868888
869889
"""
870890
_cmd = 'eddy_openmp'

nipype/interfaces/fsl/tests/test_auto_Eddy.py

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

nipype/testing/data/epi_slspec.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)