Skip to content

Commit 574bd36

Browse files
committed
Simplify DWIDenoiseInputSpec
1 parent 8cf31e6 commit 574bd36

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

nipype/interfaces/mrtrix3/preprocess.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,21 @@ class DWIDenoiseInputSpec(MRTrix3BaseInputSpec):
1616
exists=True,
1717
argstr='%s',
1818
position=-2,
19-
mandatory=True,
2019
desc='input DWI image')
2120
mask = File(
2221
exists=True,
2322
argstr='-mask %s',
2423
position=1,
25-
mandatory=False,
2624
desc='mask image')
2725
extent = traits.Tuple((traits.Int, traits.Int, traits.Int),
2826
argstr='-extent %d,%d,%d',
29-
mandatory=False,
3027
desc='set the window size of the denoising filter. (default = 5,5,5)')
3128
noise = File(
3229
argstr='-noise %s',
33-
mandatory=False,
3430
desc='noise map')
35-
out_file = File('dwi_denoised.mif',
36-
exists=False,
37-
usedefault=True,
31+
out_file = File(name_template='%s_denoised',
32+
name_source='in_file',
33+
keep_extension=True,
3834
argstr="%s",
3935
position=-1,
4036
desc="the output denoised DWI image")
@@ -77,11 +73,6 @@ class DWIDenoise(MRTrix3Base):
7773
input_spec = DWIDenoiseInputSpec
7874
output_spec = DWIDenoiseOutputSpec
7975

80-
def _list_outputs(self):
81-
outputs = self.output_spec().get()
82-
outputs['out_file'] = op.abspath(self.inputs.out_file)
83-
return outputs
84-
8576

8677
class ResponseSDInputSpec(MRTrix3BaseInputSpec):
8778
algorithm = traits.Enum(

nipype/interfaces/mrtrix3/tests/test_auto_DWIDenoise.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ def test_DWIDenoise_inputs():
1111
nohash=True,
1212
usedefault=True,
1313
),
14-
extent=dict(
15-
argstr='-extent %d,%d,%d',
16-
mandatory=False,
17-
),
14+
extent=dict(argstr='-extent %d,%d,%d', ),
1815
grad_file=dict(argstr='-grad %s', ),
1916
grad_fsl=dict(argstr='-fslgrad %s %s', ),
2017
ignore_exception=dict(
@@ -26,26 +23,23 @@ def test_DWIDenoise_inputs():
2623
in_bvec=dict(argstr='-fslgrad %s %s', ),
2724
in_file=dict(
2825
argstr='%s',
29-
mandatory=True,
3026
position=-2,
3127
),
3228
mask=dict(
3329
argstr='-mask %s',
34-
mandatory=False,
3530
position=1,
3631
),
37-
noise=dict(
38-
argstr='-noise %s',
39-
mandatory=False,
40-
),
32+
noise=dict(argstr='-noise %s', ),
4133
nthreads=dict(
4234
argstr='-nthreads %d',
4335
nohash=True,
4436
),
4537
out_file=dict(
4638
argstr='%s',
39+
keep_extension=True,
40+
name_source='in_file',
41+
name_template='%s_denoised',
4742
position=-1,
48-
usedefault=True,
4943
),
5044
terminal_output=dict(
5145
deprecated='1.0.0',

0 commit comments

Comments
 (0)