@@ -432,6 +432,20 @@ 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_gpu = traits .Str (desc = "Run eddy using gpu, possible values are "
448
+ "[openmp] or [cuda]" )
435
449
436
450
437
451
class EddyOutputSpec (TraitedSpec ):
@@ -478,7 +492,8 @@ class Eddy(FSLCommand):
478
492
def __init__ (self , ** inputs ):
479
493
super (Eddy , self ).__init__ (** inputs )
480
494
self .inputs .on_trait_change (self ._num_threads_update , 'num_threads' )
481
-
495
+ if isdefined (self .inputs .use_gpu ):
496
+ self ._use_gpu ()
482
497
if not isdefined (self .inputs .num_threads ):
483
498
self .inputs .num_threads = self ._num_threads
484
499
else :
@@ -493,6 +508,14 @@ def _num_threads_update(self):
493
508
self .inputs .environ ['OMP_NUM_THREADS' ] = str (
494
509
self .inputs .num_threads )
495
510
511
+ def _use_gpu (self ):
512
+ if self .inputs .use_gpu .lower ().startswith ('cuda' ):
513
+ _cmd = 'eddy_cuda'
514
+ elif self .inputs .use_gpu .lower ().startswith ('openmp' ):
515
+ _cmd = 'eddy_openmp'
516
+ else :
517
+ _cmd = 'eddy'
518
+
496
519
def _format_arg (self , name , spec , value ):
497
520
if name == 'in_topup_fieldcoef' :
498
521
return spec .argstr % value .split ('_fieldcoef' )[0 ]
0 commit comments