@@ -432,6 +432,19 @@ class EddyInputSpec(FSLCommandInputSpec):
432
432
desc = 'Detect and replace outlier slices' )
433
433
num_threads = traits .Int (1 , usedefault = True , nohash = True ,
434
434
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" )
435
448
436
449
437
450
class EddyOutputSpec (TraitedSpec ):
@@ -463,13 +476,13 @@ class Eddy(FSLCommand):
463
476
>>> eddy.inputs.in_bvec = 'bvecs.scheme'
464
477
>>> eddy.inputs.in_bval = 'bvals.scheme'
465
478
>>> 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 \
467
480
--imain=epi.nii --index=epi_index.txt --mask=epi_mask.nii \
468
481
--out=.../eddy_corrected'
469
482
>>> res = eddy.run() # doctest: +SKIP
470
483
471
484
"""
472
- _cmd = 'eddy '
485
+ _cmd = 'eddy_openmp '
473
486
input_spec = EddyInputSpec
474
487
output_spec = EddyOutputSpec
475
488
@@ -478,7 +491,8 @@ class Eddy(FSLCommand):
478
491
def __init__ (self , ** inputs ):
479
492
super (Eddy , self ).__init__ (** inputs )
480
493
self .inputs .on_trait_change (self ._num_threads_update , 'num_threads' )
481
-
494
+ if isdefined (self .inputs .use_cuda ):
495
+ self ._use_cuda ()
482
496
if not isdefined (self .inputs .num_threads ):
483
497
self .inputs .num_threads = self ._num_threads
484
498
else :
@@ -493,6 +507,12 @@ def _num_threads_update(self):
493
507
self .inputs .environ ['OMP_NUM_THREADS' ] = str (
494
508
self .inputs .num_threads )
495
509
510
+ def _use_cuda (self ):
511
+ if self .inputs .use_cuda :
512
+ _cmd = 'eddy_cuda'
513
+ else :
514
+ _cmd = 'eddy_openmp'
515
+
496
516
def _format_arg (self , name , spec , value ):
497
517
if name == 'in_topup_fieldcoef' :
498
518
return spec .argstr % value .split ('_fieldcoef' )[0 ]
0 commit comments