@@ -66,56 +66,56 @@ def _gen_outfilename(self):
66
66
return name + '_DT.Bdouble'
67
67
68
68
class DTMetricInputSpec (CommandLineInputSpec ):
69
- eigen_data = File (exists = True , argstr = '-inputfile %s' , mandatory = True ,
69
+ eigen_data = File (exists = True , argstr = '-inputfile %s' , mandatory = True ,
70
70
desc = 'voxel-order data filename' )
71
71
72
72
metric = traits .Enum ('fa' ,'md' ,'rd' ,'l1' , 'l2' , 'l3' , 'tr' , 'ra' , '2dfa' ,'cl' ,'cp' ,'cs' ,
73
73
argstr = '-stat %s' , mandatory = True ,
74
74
desc = ('Specifies the metric to compute. Possible choices are: '
75
75
'"fa", "md", "rd", "l1", "l2", "l3", "tr", "ra", "2dfa", "cl", "cp" or "cs".' ))
76
76
77
- inputdatatype = traits .Enum ('double' , 'float' , 'long' , 'int' , 'short' , 'char' ,
77
+ inputdatatype = traits .Enum ('double' , 'float' , 'long' , 'int' , 'short' , 'char' ,
78
78
argstr = '-inputdatatype %s' , usedefault = True ,
79
79
desc = ('Specifies the data type of the input data. '
80
80
'The data type can be any of the following strings: '
81
81
'"char", "short", "int", "long", "float" or "double".'
82
82
'Default is double data type' ))
83
83
84
- outputdatatype = traits .Enum ('double' , 'float' , 'long' , 'int' , 'short' , 'char' ,
84
+ outputdatatype = traits .Enum ('double' , 'float' , 'long' , 'int' , 'short' , 'char' ,
85
85
argstr = '-outputdatatype %s' , usedefault = True ,
86
86
desc = ('Specifies the data type of the output data. '
87
87
'The data type can be any of the following strings: '
88
88
'"char", "short", "int", "long", "float" or "double".'
89
89
'Default is double data type' ))
90
-
90
+
91
91
data_header = File (argstr = '-header %s' , exists = True ,
92
92
desc = ('A Nifti .nii or .nii.gz file containing the header information. '
93
93
'Usually this will be the header of the raw data file from which '
94
94
'the diffusion tensors were reconstructed.' ))
95
-
95
+
96
96
outputfile = File (argstr = '-outputfile %s' , genfile = True ,
97
97
desc = ('Output name. Output will be a .nii.gz file if data_header is provided and'
98
98
'in voxel order with outputdatatype datatype (default: double) otherwise.' ))
99
-
99
+
100
100
class DTMetricOutputSpec (TraitedSpec ):
101
101
metric_stats = File (exists = True , desc = 'Diffusion Tensor statistics of the chosen metric' )
102
102
103
103
class DTMetric (CommandLine ):
104
104
"""
105
105
Computes tensor metric statistics based on the eigenvalues l1 >= l2 >= l3
106
106
typically obtained from ComputeEigensystem.
107
-
107
+
108
108
The full list of statistics is:
109
-
109
+
110
110
<cl> = (l1 - l2) / l1 , a measure of linearity
111
111
<cp> = (l2 - l3) / l1 , a measure of planarity
112
112
<cs> = l3 / l1 , a measure of isotropy
113
- with: cl + cp + cs = 1
114
-
113
+ with: cl + cp + cs = 1
114
+
115
115
<l1> = first eigenvalue
116
116
<l2> = second eigenvalue
117
117
<l3> = third eigenvalue
118
-
118
+
119
119
<tr> = l1 + l2 + l3
120
120
<md> = tr / 3
121
121
<rd> = (l2 + l3) / 2
@@ -129,7 +129,7 @@ class DTMetric(CommandLine):
129
129
Example
130
130
-------
131
131
Compute the CP planar metric as float data type.
132
-
132
+
133
133
>>> import nipype.interfaces.camino as cam
134
134
>>> dtmetric = cam.DTMetric()
135
135
>>> dtmetric.inputs.eigen_data = 'dteig.Bdouble'
@@ -793,14 +793,14 @@ class ComputeEigensystemInputSpec(StdOutCommandLineInputSpec):
793
793
794
794
maxcomponents = traits .Int (argstr = '-maxcomponents %d' , desc = 'The maximum number of tensor components in a voxel of the input data.' )
795
795
796
- inputdatatype = traits .Enum ('double' , 'float' , 'long' , 'int' , 'short' , 'char' ,
796
+ inputdatatype = traits .Enum ('double' , 'float' , 'long' , 'int' , 'short' , 'char' ,
797
797
argstr = '-inputdatatype %s' , usedefault = True ,
798
798
desc = ('Specifies the data type of the input data. '
799
799
'The data type can be any of the following strings: '
800
800
'"char", "short", "int", "long", "float" or "double".'
801
801
'Default is double data type' ))
802
802
803
- outputdatatype = traits .Enum ('double' , 'float' , 'long' , 'int' , 'short' , 'char' ,
803
+ outputdatatype = traits .Enum ('double' , 'float' , 'long' , 'int' , 'short' , 'char' ,
804
804
argstr = '-outputdatatype %s' , usedefault = True ,
805
805
desc = ('Specifies the data type of the output data. '
806
806
'The data type can be any of the following strings: '
0 commit comments