File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 14
14
try :
15
15
package_check ('dipy' )
16
16
import dipy .reconst .dti as dti
17
+ from dipy .core .gradients import GradientTable
17
18
except Exception , e :
18
19
warnings .warn ('dipy not installed' )
19
20
@@ -53,9 +54,14 @@ def _run_interface(self, runtime):
53
54
bvals = np .loadtxt (self .inputs .bvals )
54
55
gradients = np .loadtxt (self .inputs .bvecs ).T
55
56
56
- tensor = dti .Tensor (data ,bvals ,gradients ,thresh = 50 )
57
-
58
- mode_data = tensor .mode
57
+ gtab = GradientTable (gradients )
58
+ gtab .bvals = bvals
59
+
60
+ mask = data [..., 0 ] > 50
61
+ tenmodel = dti .TensorModel (gtab )
62
+ tenfit = tenmodel .fit (data , mask )
63
+
64
+ mode_data = tenfit .mode
59
65
img = nb .Nifti1Image (mode_data ,affine )
60
66
out_file = op .abspath (self .inputs .out_filename )
61
67
nb .save (img , out_file )
You can’t perform that action at this time.
0 commit comments