@@ -23,20 +23,27 @@ class DWIDenoiseInputSpec(MRTrix3BaseInputSpec):
23
23
argstr = '-mask %s' ,
24
24
position = 1 ,
25
25
desc = 'mask image' )
26
- extent = traits .Tuple ((traits .Int , traits .Int , traits .Int ),
26
+ extent = traits .Tuple (
27
+ (traits .Int , traits .Int , traits .Int ),
27
28
argstr = '-extent %d,%d,%d' ,
28
29
desc = 'set the window size of the denoising filter. (default = 5,5,5)' )
29
30
noise = File (
30
31
argstr = '-noise %s' ,
31
- desc = 'the output noise map' )
32
- out_file = File (name_template = '%s_denoised' ,
32
+ name_template = '%s_noise' ,
33
33
name_source = 'in_file' ,
34
34
keep_extension = True ,
35
+ desc = 'the output noise map' ,
36
+ genfile = True )
37
+ out_file = File (
35
38
argstr = '%s' ,
36
39
position = - 1 ,
40
+ name_template = '%s_denoised' ,
41
+ name_source = 'in_file' ,
42
+ keep_extension = True ,
37
43
desc = 'the output denoised DWI image' ,
38
44
genfile = True )
39
45
46
+
40
47
class DWIDenoiseOutputSpec (TraitedSpec ):
41
48
noise = File (desc = 'the output noise map' , exists = True )
42
49
out_file = File (desc = 'the output denoised DWI image' , exists = True )
@@ -76,13 +83,6 @@ class DWIDenoise(MRTrix3Base):
76
83
input_spec = DWIDenoiseInputSpec
77
84
output_spec = DWIDenoiseOutputSpec
78
85
79
- def _list_outputs (self ):
80
- outputs = self .output_spec ().get ()
81
- outputs ['out_file' ] = op .abspath (self .inputs .out_file )
82
- if self .inputs .noise != Undefined :
83
- outputs ['noise' ] = op .abspath (self .inputs .noise )
84
- return outputs
85
-
86
86
87
87
class MRDeGibbsInputSpec (MRTrix3BaseInputSpec ):
88
88
in_file = File (
@@ -92,32 +92,29 @@ class MRDeGibbsInputSpec(MRTrix3BaseInputSpec):
92
92
mandatory = True ,
93
93
desc = 'input DWI image' )
94
94
axes = traits .ListInt (
95
- default_value = [0 ,1 ],
96
- usedefault = True ,
95
+ [0 ,1 ],
97
96
sep = ',' ,
98
97
minlen = 2 ,
99
98
maxlen = 2 ,
100
99
argstr = '-axes %s' ,
101
100
desc = 'indicate the plane in which the data was acquired (axial = 0,1; '
102
101
'coronal = 0,2; sagittal = 1,2' )
103
102
nshifts = traits .Int (
104
- default_value = 20 ,
105
- usedefault = True ,
103
+ 20 ,
106
104
argstr = '-nshifts %d' ,
107
105
desc = 'discretization of subpixel spacing (default = 20)' )
108
106
minW = traits .Int (
109
- default_value = 1 ,
110
- usedefault = True ,
107
+ 1 ,
111
108
argstr = '-minW %d' ,
112
109
desc = 'left border of window used for total variation (TV) computation '
113
110
'(default = 1)' )
114
111
maxW = traits .Int (
115
- default_value = 3 ,
116
- usedefault = True ,
112
+ 3 ,
117
113
argstr = '-maxW %d' ,
118
114
desc = 'right border of window used for total variation (TV) computation '
119
115
'(default = 3)' )
120
- out_file = File (name_template = '%s_unr' ,
116
+ out_file = File (
117
+ name_template = '%s_unr' ,
121
118
name_source = 'in_file' ,
122
119
keep_extension = True ,
123
120
argstr = '%s' ,
@@ -160,7 +157,7 @@ class MRDeGibbs(MRTrix3Base):
160
157
>>> unring = mrt.MRDeGibbs()
161
158
>>> unring.inputs.in_file = 'dwi.mif'
162
159
>>> unring.cmdline
163
- 'mrdegibbs -axes 0,1 -maxW 3 -minW 1 -nshifts 20 dwi.mif dwi_unr.mif'
160
+ 'mrdegibbs dwi.mif dwi_unr.mif'
164
161
>>> unring.run() # doctest: +SKIP
165
162
"""
166
163
@@ -179,31 +176,19 @@ class DWIBiasCorrectInputSpec(MRTrix3BaseInputSpec):
179
176
in_mask = File (
180
177
argstr = '-mask %s' ,
181
178
desc = 'input mask image for bias field estimation' )
182
- _xor_methods = ('use_ants' , 'use_fsl' )
183
179
use_ants = traits .Bool (
184
- default_value = True ,
185
- usedefault = True ,
186
180
argstr = '-ants' ,
187
181
desc = 'use ANTS N4 to estimate the inhomogeneity field' ,
188
- xor = _xor_methods )
182
+ xor = [ 'use_fsl' ] )
189
183
use_fsl = traits .Bool (
190
184
argstr = '-fsl' ,
191
185
desc = 'use FSL FAST to estimate the inhomogeneity field' ,
192
- xor = _xor_methods ,
193
- min_ver = '5.0.10' )
194
- _xor_grads = ('mrtrix_grad' , 'fsl_grad' )
195
- mrtrix_grad = File (
196
- argstr = '-grad %s' ,
197
- desc = 'diffusion gradient table in MRtrix format' ,
198
- xor = _xor_grads )
199
- fsl_grad = File (
200
- argstr = '-fslgrad %s %s' ,
201
- desc = 'diffusion gradient table in FSL bvecs/bvals format' ,
202
- xor = _xor_grads )
186
+ xor = ['use_ants' ])
203
187
bias = File (
204
188
argstr = '-bias %s' ,
205
189
desc = 'bias field' )
206
- out_file = File (name_template = '%s_biascorr' ,
190
+ out_file = File (
191
+ name_template = '%s_biascorr' ,
207
192
name_source = 'in_file' ,
208
193
keep_extension = True ,
209
194
argstr = '%s' ,
@@ -237,13 +222,6 @@ class DWIBiasCorrect(MRTrix3Base):
237
222
input_spec = DWIBiasCorrectInputSpec
238
223
output_spec = DWIBiasCorrectOutputSpec
239
224
240
- def _list_outputs (self ):
241
- outputs = self .output_spec ().get ()
242
- outputs ['out_file' ] = op .abspath (self .inputs .out_file )
243
- if self .inputs .bias != Undefined :
244
- outputs ['bias' ] = op .abspath (self .inputs .bias )
245
- return outputs
246
-
247
225
248
226
class ResponseSDInputSpec (MRTrix3BaseInputSpec ):
249
227
algorithm = traits .Enum (
0 commit comments