@@ -432,6 +432,19 @@ class EddyInputSpec(FSLCommandInputSpec):
432432 desc = 'Detect and replace outlier slices' )
433433 num_threads = traits .Int (1 , usedefault = True , nohash = True ,
434434 desc = "Number of openmp threads to use" )
435+ is_shelled = traits .Bool (False , argstr = '--data_is_shelled' ,
436+ desc = "Override internal check to ensure that "
437+ "date are acquired on a set of b-value "
438+ "shells" )
439+ field = traits .Str (argstr = '--field=%s' ,
440+ desc = "NonTOPUP fieldmap scaled in Hz - filename has "
441+ "to be provided without an extension. TOPUP is "
442+ "strongly recommended" )
443+ field_mat = File (exists = True , argstr = '--field_mat=%s' ,
444+ desc = "Matrix that specifies the relative locations of "
445+ "the field specified by --field and first volume "
446+ "in file --imain" )
447+ use_cuda = traits .Bool (False , desc = "Run eddy using cuda gpu" )
435448
436449
437450class EddyOutputSpec (TraitedSpec ):
@@ -463,13 +476,13 @@ class Eddy(FSLCommand):
463476 >>> eddy.inputs.in_bvec = 'bvecs.scheme'
464477 >>> eddy.inputs.in_bval = 'bvals.scheme'
465478 >>> eddy.cmdline # doctest: +ELLIPSIS +ALLOW_UNICODE
466- 'eddy --acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \
479+ 'eddy_openmp --acqp=epi_acqp.txt --bvals=bvals.scheme --bvecs=bvecs.scheme \
467480 --imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
468481 --out=.../eddy_corrected'
469482 >>> res = eddy.run() # doctest: +SKIP
470483
471484 """
472- _cmd = 'eddy '
485+ _cmd = 'eddy_openmp '
473486 input_spec = EddyInputSpec
474487 output_spec = EddyOutputSpec
475488
@@ -478,7 +491,8 @@ class Eddy(FSLCommand):
478491 def __init__ (self , ** inputs ):
479492 super (Eddy , self ).__init__ (** inputs )
480493 self .inputs .on_trait_change (self ._num_threads_update , 'num_threads' )
481-
494+ if isdefined (self .inputs .use_cuda ):
495+ self ._use_cuda ()
482496 if not isdefined (self .inputs .num_threads ):
483497 self .inputs .num_threads = self ._num_threads
484498 else :
@@ -493,6 +507,12 @@ def _num_threads_update(self):
493507 self .inputs .environ ['OMP_NUM_THREADS' ] = str (
494508 self .inputs .num_threads )
495509
510+ def _use_cuda (self ):
511+ if self .inputs .use_cuda :
512+ _cmd = 'eddy_cuda'
513+ else :
514+ _cmd = 'eddy_openmp'
515+
496516 def _format_arg (self , name , spec , value ):
497517 if name == 'in_topup_fieldcoef' :
498518 return spec .argstr % value .split ('_fieldcoef' )[0 ]
0 commit comments