Skip to content

Commit ef7c805

Browse files
committed
update mrdegibbs and dwibiascorrect
1 parent 83bc6a4 commit ef7c805

File tree

1 file changed

+33
-28
lines changed

1 file changed

+33
-28
lines changed

nipype/interfaces/mrtrix3/preprocess.py

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ class DWIDenoiseInputSpec(MRTrix3BaseInputSpec):
3030
name_source='in_file',
3131
keep_extension=True,
3232
argstr='-noise %s',
33-
desc="the output noise map",
33+
desc='the output noise map',
3434
genfile=True)
3535
out_file = File(name_template='%s_denoised',
3636
name_source='in_file',
3737
keep_extension=True,
38-
argstr="%s",
38+
argstr='%s',
3939
position=-1,
40-
desc="the output denoised DWI image",
40+
desc='the output denoised DWI image',
4141
genfile=True)
4242

4343
class DWIDenoiseOutputSpec(TraitedSpec):
44-
out_noisemap = File(desc="the output noise map", exists=True)
45-
out_file = File(desc="the output denoised DWI image", exists=True)
44+
out_noisemap = File(desc='the output noise map', exists=True)
45+
out_file = File(desc='the output denoised DWI image', exists=True)
4646

4747
class DWIDenoise(MRTrix3Base):
4848
"""
@@ -89,17 +89,18 @@ class MRDeGibbsInputSpec(MRTrix3BaseInputSpec):
8989
desc='input DWI image')
9090
axes = traits.ListInt(
9191
default_value=[0,1],
92-
sep=',',
93-
minlen=1,
94-
maxlen=4,
9592
usedefault=True,
93+
sep=',',
94+
minlen=2,
95+
maxlen=2,
9696
argstr='-axes %s',
97-
desc='select the slice axes (default = 0,1)')
97+
desc='indicate the plane in which the data was acquired (axial = 0,1; '
98+
'coronal = 0,2; sagittal = 1,2')
9899
nshifts = traits.Int(
99100
default_value=20,
100101
usedefault=True,
101102
argstr='-nshifts %d',
102-
desc='discretizaiton of subpixel spacing (default = 20)')
103+
desc='discretization of subpixel spacing (default = 20)')
103104
minW = traits.Int(
104105
default_value=1,
105106
usedefault=True,
@@ -112,16 +113,16 @@ class MRDeGibbsInputSpec(MRTrix3BaseInputSpec):
112113
argstr='-maxW %d',
113114
desc='right border of window used for total variation (TV) computation '
114115
'(default = 3)')
115-
out_file = File(name_template='%s_unring',
116+
out_file = File(name_template='%s_unr',
116117
name_source='in_file',
117118
keep_extension=True,
118-
argstr="%s",
119+
argstr='%s',
119120
position=-1,
120-
desc="the output unringed DWI image",
121+
desc='the output unringed DWI image',
121122
genfile=True)
122123

123124
class MRDeGibbsOutputSpec(TraitedSpec):
124-
out_file = File(desc="the output unringed DWI image", exists=True)
125+
out_file = File(desc='the output unringed DWI image', exists=True)
125126

126127
class MRDeGibbs(MRTrix3Base):
127128
"""
@@ -155,7 +156,7 @@ class MRDeGibbs(MRTrix3Base):
155156
>>> unring = mrt.MRDeGibbs()
156157
>>> unring.inputs.in_file = 'dwi.mif'
157158
>>> unring.cmdline # doctest: +ELLIPSIS
158-
'mrdegibbs dwi.mif dwi_unring.mif'
159+
'mrdegibbs dwi.mif dwi_unr.mif'
159160
>>> unring.run() # doctest: +SKIP
160161
"""
161162

@@ -174,23 +175,27 @@ class DWIBiasCorrectInputSpec(MRTrix3BaseInputSpec):
174175
in_mask = File(
175176
argstr='-mask %s',
176177
desc='input mask image for bias field estimation')
177-
_xor_inputs = ('use_ants', 'use_fsl')
178+
_xor_methods = ('use_ants', 'use_fsl')
178179
use_ants = traits.Bool(
180+
default_value=True,
181+
usedefault=True,
179182
argstr='-ants',
180183
desc='use ANTS N4 to estimate the inhomogeneity field',
181-
xor=_xor_inputs)
184+
xor=_xor_methods)
182185
use_fsl = traits.Bool(
183186
argstr='-fsl',
184187
desc='use FSL FAST to estimate the inhomogeneity field',
185-
xor=_xor_inputs,
188+
xor=_xor_methods,
186189
min_ver='5.0.10')
187-
# only one of either grad or fslgrad should be supplied
188-
grad = File(
190+
_xor_grads = ('mrtrix_grad', 'fsl_grad')
191+
mrtrix_grad = File(
189192
argstr='-grad %s',
190-
desc='diffusion gradient table in MRtrix format')
191-
fslgrad = File(
193+
desc='diffusion gradient table in MRtrix format',
194+
xor=_xor_grads)
195+
fsl_grad = File(
192196
argstr='-fslgrad %s %s',
193-
desc='diffusion gradient table in FSL bvecs/bvals format')
197+
desc='diffusion gradient table in FSL bvecs/bvals format',
198+
xor=_xor_grads)
194199
out_bias = File(name_template='%s_biasfield',
195200
name_source='in_file',
196201
keep_extension=True,
@@ -200,14 +205,14 @@ class DWIBiasCorrectInputSpec(MRTrix3BaseInputSpec):
200205
out_file = File(name_template='%s_biascorr',
201206
name_source='in_file',
202207
keep_extension=True,
203-
argstr="%s",
208+
argstr='%s',
204209
position=-1,
205-
desc="the output bias corrected DWI image",
210+
desc='the output bias corrected DWI image',
206211
genfile=True)
207212

208213
class DWIBiasCorrectOutputSpec(TraitedSpec):
209-
out_bias = File(desc="the output estimated bias field")
210-
out_file = File(desc="the output bias corrected DWI image", exists=True)
214+
out_bias = File(desc='the output estimated bias field')
215+
out_file = File(desc='the output bias corrected DWI image', exists=True)
211216

212217
class DWIBiasCorrect(MRTrix3Base):
213218
"""
@@ -223,7 +228,7 @@ class DWIBiasCorrect(MRTrix3Base):
223228
>>> bias_correct = mrt.DWIBiasCorrect()
224229
>>> bias_correct.inputs.in_file = 'dwi.mif'
225230
>>> bias_correct.cmdline # doctest: +ELLIPSIS
226-
'dwibiascorrect dwi.mif dwi_biascorr.mif'
231+
'dwibiascorrect -ants dwi.mif dwi_biascorr.mif'
227232
>>> bias_correct.run() # doctest: +SKIP
228233
"""
229234

0 commit comments

Comments
 (0)