@@ -23,20 +23,27 @@ class DWIDenoiseInputSpec(MRTrix3BaseInputSpec):
2323 argstr = '-mask %s' ,
2424 position = 1 ,
2525 desc = 'mask image' )
26- extent = traits .Tuple ((traits .Int , traits .Int , traits .Int ),
26+ extent = traits .Tuple (
27+ (traits .Int , traits .Int , traits .Int ),
2728 argstr = '-extent %d,%d,%d' ,
2829 desc = 'set the window size of the denoising filter. (default = 5,5,5)' )
2930 noise = File (
3031 argstr = '-noise %s' ,
31- desc = 'the output noise map' )
32- out_file = File (name_template = '%s_denoised' ,
32+ name_template = '%s_noise' ,
3333 name_source = 'in_file' ,
3434 keep_extension = True ,
35+ desc = 'the output noise map' ,
36+ genfile = True )
37+ out_file = File (
3538 argstr = '%s' ,
3639 position = - 1 ,
40+ name_template = '%s_denoised' ,
41+ name_source = 'in_file' ,
42+ keep_extension = True ,
3743 desc = 'the output denoised DWI image' ,
3844 genfile = True )
3945
46+
4047class DWIDenoiseOutputSpec (TraitedSpec ):
4148 noise = File (desc = 'the output noise map' , exists = True )
4249 out_file = File (desc = 'the output denoised DWI image' , exists = True )
@@ -76,13 +83,6 @@ class DWIDenoise(MRTrix3Base):
7683 input_spec = DWIDenoiseInputSpec
7784 output_spec = DWIDenoiseOutputSpec
7885
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-
8686
8787class MRDeGibbsInputSpec (MRTrix3BaseInputSpec ):
8888 in_file = File (
@@ -92,32 +92,29 @@ class MRDeGibbsInputSpec(MRTrix3BaseInputSpec):
9292 mandatory = True ,
9393 desc = 'input DWI image' )
9494 axes = traits .ListInt (
95- default_value = [0 ,1 ],
96- usedefault = True ,
95+ [0 ,1 ],
9796 sep = ',' ,
9897 minlen = 2 ,
9998 maxlen = 2 ,
10099 argstr = '-axes %s' ,
101100 desc = 'indicate the plane in which the data was acquired (axial = 0,1; '
102101 'coronal = 0,2; sagittal = 1,2' )
103102 nshifts = traits .Int (
104- default_value = 20 ,
105- usedefault = True ,
103+ 20 ,
106104 argstr = '-nshifts %d' ,
107105 desc = 'discretization of subpixel spacing (default = 20)' )
108106 minW = traits .Int (
109- default_value = 1 ,
110- usedefault = True ,
107+ 1 ,
111108 argstr = '-minW %d' ,
112109 desc = 'left border of window used for total variation (TV) computation '
113110 '(default = 1)' )
114111 maxW = traits .Int (
115- default_value = 3 ,
116- usedefault = True ,
112+ 3 ,
117113 argstr = '-maxW %d' ,
118114 desc = 'right border of window used for total variation (TV) computation '
119115 '(default = 3)' )
120- out_file = File (name_template = '%s_unr' ,
116+ out_file = File (
117+ name_template = '%s_unr' ,
121118 name_source = 'in_file' ,
122119 keep_extension = True ,
123120 argstr = '%s' ,
@@ -160,7 +157,7 @@ class MRDeGibbs(MRTrix3Base):
160157 >>> unring = mrt.MRDeGibbs()
161158 >>> unring.inputs.in_file = 'dwi.mif'
162159 >>> 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'
164161 >>> unring.run() # doctest: +SKIP
165162 """
166163
@@ -179,31 +176,19 @@ class DWIBiasCorrectInputSpec(MRTrix3BaseInputSpec):
179176 in_mask = File (
180177 argstr = '-mask %s' ,
181178 desc = 'input mask image for bias field estimation' )
182- _xor_methods = ('use_ants' , 'use_fsl' )
183179 use_ants = traits .Bool (
184- default_value = True ,
185- usedefault = True ,
186180 argstr = '-ants' ,
187181 desc = 'use ANTS N4 to estimate the inhomogeneity field' ,
188- xor = _xor_methods )
182+ xor = [ 'use_fsl' ] )
189183 use_fsl = traits .Bool (
190184 argstr = '-fsl' ,
191185 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' ])
203187 bias = File (
204188 argstr = '-bias %s' ,
205189 desc = 'bias field' )
206- out_file = File (name_template = '%s_biascorr' ,
190+ out_file = File (
191+ name_template = '%s_biascorr' ,
207192 name_source = 'in_file' ,
208193 keep_extension = True ,
209194 argstr = '%s' ,
@@ -237,13 +222,6 @@ class DWIBiasCorrect(MRTrix3Base):
237222 input_spec = DWIBiasCorrectInputSpec
238223 output_spec = DWIBiasCorrectOutputSpec
239224
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-
247225
248226class ResponseSDInputSpec (MRTrix3BaseInputSpec ):
249227 algorithm = traits .Enum (
0 commit comments