@@ -44,6 +44,10 @@ class MRTrix3BaseInputSpec(CommandLineInputSpec):
4444 'BValueScaling entry. Valid choices are yes / no, true / '
4545 'false, 0 / 1 (default: true).' )
4646
47+ in_bvec = File (exists = True , argstr = '-fslgrad %s %s' ,
48+ desc = 'bvecs file in FSL format' )
49+ in_bval = File (exists = True , desc = 'bvals file in FSL format' )
50+
4751
4852class MRTrix3Base (CommandLine ):
4953
@@ -58,4 +62,24 @@ def _format_arg(self, name, trait_spec, value):
5862 pass
5963 return trait_spec .argstr % value
6064
65+ if name == 'in_bvec' :
66+ return trait_spec .argstr % (value , self .inputs .in_bval )
67+
6168 return super (MRTrix3Base , self )._format_arg (name , trait_spec , value )
69+
70+ def _parse_inputs (self , skip = None ):
71+ if skip is None :
72+ skip = []
73+ if (isdefined (self .inputs .grad_file ) or
74+ isdefined (self .inputs .grad_fsl )):
75+ skip += ['in_bvec' , 'in_bval' ]
76+
77+ is_bvec = isdefined (self .inputs .in_bvec )
78+ is_bval = isdefined (self .inputs .in_bval )
79+ if is_bvec or is_bval :
80+ if not is_bvec or not is_bval :
81+ raise RuntimeError ('If using bvecs and bvals inputs, both'
82+ 'should be defined' )
83+ skip += ['in_bval' ]
84+
85+ return super (MRTrix3Base , self )._parse_inputs (skip = skip )
0 commit comments