Skip to content

Commit d7d1a36

Browse files
josephmjeeffigies
authored andcommitted
add doctest for running eddy with s2v motion correction
1 parent 3040ef5 commit d7d1a36

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

nipype/interfaces/fsl/epi.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,7 @@ class EddyInputSpec(FSLCommandInputSpec):
741741
mporder = traits.Int(
742742
argstr="--mporder=%s",
743743
desc="Order of slice-to-vol movement model",
744+
requires=["use_cuda"],
744745
min_ver="5.0.11",
745746
)
746747
s2v_niter = traits.Int(
@@ -959,14 +960,32 @@ class Eddy(FSLCommand):
959960
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
960961
--interp=spline --resamp=jac --niter=5 --nvoxhp=1000 \
961962
--out=.../eddy_corrected --slm=none'
963+
964+
Running eddy on a CPU using OpenMP:
962965
>>> eddy.inputs.use_cuda = False
963-
>>> eddy.cmdline # doctest: +ELLIPSIS
966+
>>> eddy.cmdline # doctest: +ELLIPSIS
964967
'eddy_openmp --flm=quadratic --ff=10.0 --fwhm=0.0 \
965968
--acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \
966969
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
967970
--interp=spline --resamp=jac --niter=5 --nvoxhp=1000 \
968971
--out=.../eddy_corrected --slm=none'
969-
>>> res = eddy.run() # doctest: +SKIP
972+
973+
Running eddy with slice-to-volume motion correction:
974+
>>> eddy.inputs.use_cuda = True
975+
>>> eddy.inputs.mporder = 6
976+
>>> eddy.inputs.s2v_niter = 5
977+
>>> eddy.inputs.s2v_lambda = 1
978+
>>> eddy.inputs.s2v_interp = 'trilinear'
979+
>>> eddy.inputs.slspec = 'epi_slspec.txt'
980+
>>> eddy.cmdline # doctest: +ELLIPSIS
981+
'eddy_cuda --flm=quadratic --ff=10.0 --fwhm=0.0 \
982+
--acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \
983+
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
984+
--interp=spline --resamp=jac --mporder=6 --niter=5 --nvoxhp=1000 \
985+
--out=.../eddy_corrected --s2v_interp=trilinear --s2v_niter=5 \
986+
--slm=none --slspec=epi_slspec.txt'
987+
>>> res = eddy.run() # doctest: +SKIP
988+
970989
"""
971990

972991
_cmd = "eddy_openmp"

nipype/interfaces/fsl/tests/test_auto_Eddy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_Eddy_inputs():
5252
requires=["estimate_move_by_susceptibility"],
5353
),
5454
method=dict(argstr="--resamp=%s", usedefault=True,),
55-
mporder=dict(argstr="--mporder=%s", min_ver="5.0.11",),
55+
mporder=dict(argstr="--mporder=%s", min_ver="5.0.11", requires=["use_cuda"],),
5656
niter=dict(argstr="--niter=%s", usedefault=True,),
5757
num_threads=dict(nohash=True, usedefault=True,),
5858
nvoxhp=dict(argstr="--nvoxhp=%s", usedefault=True,),

0 commit comments

Comments
 (0)