Skip to content

Commit c6fa91b

Browse files
committed
added mandatory flag, added config to travis that broke tests
1 parent e49bfb9 commit c6fa91b

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ before_install:
2424
fi
2525
- if $INSTALL_DEB_DEPENDECIES; then source /etc/fsl/fsl.sh; fi
2626
- if $INSTALL_DEB_DEPENDECIES; then source /etc/afni/afni.sh; fi
27+
- source FSLOUTPUTTYPE=NIFTI_GZ
2728
install:
2829
- conda update --yes conda
2930
- conda create -n testenv --yes pip python=$TRAVIS_PYTHON_VERSION

nipype/interfaces/fsl/tests/test_auto_Smooth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def test_Smooth_inputs():
1010
usedefault=True,
1111
),
1212
fwhm=dict(argstr='-kernel gauss %.03f -fmean',
13+
mandatory=True,
1314
position=1,
1415
xor=['sigma'],
1516
),
@@ -22,6 +23,7 @@ def test_Smooth_inputs():
2223
),
2324
output_type=dict(),
2425
sigma=dict(argstr='-kernel gauss %.03f -fmean',
26+
mandatory=True,
2527
position=1,
2628
xor=['fwhm'],
2729
),

nipype/interfaces/fsl/utils.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ def _gen_filename(self, name):
139139

140140
class SmoothInputSpec(FSLCommandInputSpec):
141141
in_file = File(exists=True, argstr="%s", position=0, mandatory=True)
142-
fwhm = traits.Float(
143-
argstr="-kernel gauss %.03f -fmean", position=1, xor=['sigma'],
144-
desc='gaussian kernel fwhm, will be converted to sigma in mm (not voxels)')
145142
sigma = traits.Float(
146-
argstr="-kernel gauss %.03f -fmean", position=1, xor=['fwhm'],
143+
argstr="-kernel gauss %.03f -fmean", position=1, xor=['fwhm'], mandatory=True,
147144
desc='gaussian kernel sigma in mm (not voxels)')
145+
fwhm = traits.Float(
146+
argstr="-kernel gauss %.03f -fmean", position=1, xor=['sigma'], mandatory=True,
147+
desc='gaussian kernel fwhm, will be converted to sigma in mm (not voxels)')
148148
smoothed_file = File(
149149
argstr="%s", position=2, name_source=['in_file'], name_template='%s_smooth', hash_files=False)
150150

@@ -181,10 +181,10 @@ class Smooth(FSLCommand):
181181
>>> from nipype.interfaces.fsl import Smooth
182182
>>> sm = Smooth()
183183
>>> sm.inputs.in_file = 'functional2.nii'
184-
>>> sm.cmdline
184+
>>> sm.cmdline #doctest: +ELLIPSIS
185185
Traceback (most recent call last):
186186
...
187-
RuntimeError: either sigma (in mm) or fwhm need be specified.
187+
ValueError: Smooth requires a value for one of the inputs 'sigma'. ...
188188
189189
"""
190190

@@ -198,11 +198,6 @@ def _format_arg(self, name, trait_spec, value):
198198
return super(Smooth, self)._format_arg(name, trait_spec, sigma)
199199
return super(Smooth, self)._format_arg(name, trait_spec, value)
200200

201-
def _parse_inputs(self, skip=None):
202-
if not isdefined(self.inputs.sigma) and not isdefined(self.inputs.fwhm):
203-
raise RuntimeError('either sigma (in mm) or fwhm need be specified.')
204-
return super(Smooth, self)._parse_inputs(skip=skip)
205-
206201

207202
class MergeInputSpec(FSLCommandInputSpec):
208203
in_files = traits.List(File(exists=True), argstr="%s", position=2,

0 commit comments

Comments
 (0)