@@ -23,19 +23,24 @@ class DWIDenoiseInputSpec(MRTrix3BaseInputSpec):
2323 argstr = '-mask %s' ,
2424 position = 1 ,
2525 desc = 'mask image' )
26- extent = Tuple ((traits .Int , traits .Int , traits .Int ),
26+ extent = 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+ out_file = File (
3537 argstr = '%s' ,
3638 position = - 1 ,
37- desc = 'the output denoised DWI image' ,
38- genfile = True )
39+ name_template = '%s_denoised' ,
40+ name_source = 'in_file' ,
41+ keep_extension = True ,
42+ desc = 'the output denoised DWI image' )
43+
3944
4045class DWIDenoiseOutputSpec (TraitedSpec ):
4146 noise = File (desc = 'the output noise map' , exists = True )
@@ -67,22 +72,16 @@ class DWIDenoise(MRTrix3Base):
6772 >>> denoise = mrt.DWIDenoise()
6873 >>> denoise.inputs.in_file = 'dwi.mif'
6974 >>> denoise.inputs.mask = 'mask.mif'
75+ >>> denoise.inputs.noise = 'noise.mif'
7076 >>> denoise.cmdline # doctest: +ELLIPSIS
71- 'dwidenoise -mask mask.mif dwi.mif dwi_denoised.mif'
77+ 'dwidenoise -mask mask.mif -noise noise.mif dwi.mif dwi_denoised.mif'
7278 >>> denoise.run() # doctest: +SKIP
7379 """
7480
7581 _cmd = 'dwidenoise'
7682 input_spec = DWIDenoiseInputSpec
7783 output_spec = DWIDenoiseOutputSpec
7884
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-
8685
8786class MRDeGibbsInputSpec (MRTrix3BaseInputSpec ):
8887 in_file = File (
@@ -92,7 +91,7 @@ class MRDeGibbsInputSpec(MRTrix3BaseInputSpec):
9291 mandatory = True ,
9392 desc = 'input DWI image' )
9493 axes = traits .ListInt (
95- default_value = [0 ,1 ],
94+ default_value = [0 , 1 ],
9695 usedefault = True ,
9796 sep = ',' ,
9897 minlen = 2 ,
@@ -117,13 +116,13 @@ class MRDeGibbsInputSpec(MRTrix3BaseInputSpec):
117116 argstr = '-maxW %d' ,
118117 desc = 'right border of window used for total variation (TV) computation '
119118 '(default = 3)' )
120- out_file = File (name_template = '%s_unr' ,
119+ out_file = File (
120+ name_template = '%s_unr' ,
121121 name_source = 'in_file' ,
122122 keep_extension = True ,
123123 argstr = '%s' ,
124124 position = - 1 ,
125- desc = 'the output unringed DWI image' ,
126- genfile = True )
125+ desc = 'the output unringed DWI image' )
127126
128127class MRDeGibbsOutputSpec (TraitedSpec ):
129128 out_file = File (desc = 'the output unringed DWI image' , exists = True )
@@ -179,31 +178,21 @@ class DWIBiasCorrectInputSpec(MRTrix3BaseInputSpec):
179178 in_mask = File (
180179 argstr = '-mask %s' ,
181180 desc = 'input mask image for bias field estimation' )
182- _xor_methods = ('use_ants' , 'use_fsl' )
183181 use_ants = traits .Bool (
184- default_value = True ,
185- usedefault = True ,
186182 argstr = '-ants' ,
183+ mandatory = True ,
187184 desc = 'use ANTS N4 to estimate the inhomogeneity field' ,
188- xor = _xor_methods )
185+ xor = [ 'use_fsl' ] )
189186 use_fsl = traits .Bool (
190187 argstr = '-fsl' ,
188+ mandatory = True ,
191189 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 )
190+ xor = ['use_ants' ])
203191 bias = File (
204192 argstr = '-bias %s' ,
205193 desc = 'bias field' )
206- out_file = File (name_template = '%s_biascorr' ,
194+ out_file = File (
195+ name_template = '%s_biascorr' ,
207196 name_source = 'in_file' ,
208197 keep_extension = True ,
209198 argstr = '%s' ,
@@ -228,6 +217,7 @@ class DWIBiasCorrect(MRTrix3Base):
228217 >>> import nipype.interfaces.mrtrix3 as mrt
229218 >>> bias_correct = mrt.DWIBiasCorrect()
230219 >>> bias_correct.inputs.in_file = 'dwi.mif'
220+ >>> bias_correct.inputs.use_ants = True
231221 >>> bias_correct.cmdline
232222 'dwibiascorrect -ants dwi.mif dwi_biascorr.mif'
233223 >>> bias_correct.run() # doctest: +SKIP
@@ -237,13 +227,6 @@ class DWIBiasCorrect(MRTrix3Base):
237227 input_spec = DWIBiasCorrectInputSpec
238228 output_spec = DWIBiasCorrectOutputSpec
239229
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-
247230
248231class ResponseSDInputSpec (MRTrix3BaseInputSpec ):
249232 algorithm = traits .Enum (
0 commit comments