@@ -7,6 +7,7 @@ class DipyBaseInterfaceInputSpec(BaseInterfaceInputSpec):
7
7
in_file = File (exists = True , mandatory = True , desc = ('input diffusion data' ))
8
8
in_bval = File (exists = True , mandatory = True , desc = ('input b-values table' ))
9
9
in_bvec = File (exists = True , mandatory = True , desc = ('input b-vectors table' ))
10
+ b0_thres = traits .Int (700 , usedefault = True , desc = ('b0 threshold' ))
10
11
out_prefix = traits .Str (desc = ('output prefix for file names' ))
11
12
12
13
@@ -18,9 +19,17 @@ class DipyBaseInterface(BaseInterface):
18
19
input_spec = DipyBaseInterfaceInputSpec
19
20
20
21
def _get_gradient_table (self ):
21
- gtab = GradientTable (np .loadtxt (self .inputs .in_bvec ).T )
22
- gtab .b0_threshold = 700
23
- gtab .bvals = np .loadtxt (self .inputs .in_bval )
22
+ bval = np .loadtxt (self .inputs .in_bval )
23
+ bvec = np .loadtxt (self .inputs .in_bvec ).T
24
+ try :
25
+ from dipy .data import GradientTable
26
+ gtab = GradientTable (bvec )
27
+ gtab .bvals = bval
28
+ except NameError :
29
+ from dipy .core .gradients import gradient_table
30
+ gtab = gradient_table (bval , bvec )
31
+
32
+ gtab .b0_threshold = self .inputs .b0_thres
24
33
return gtab
25
34
26
35
def _gen_filename (self , name , ext = None ):
0 commit comments