Skip to content

Commit ba15d5f

Browse files
committed
fix: autotest conflict
2 parents 0ee9b72 + 9d1b661 commit ba15d5f

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

nipype/interfaces/fsl/preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ def _parse_inputs(self, skip=None):
563563
if not isdefined(self.inputs.verbose) or self.inputs.verbose == 0:
564564
self.inputs.verbose = 1
565565
if isdefined(self.inputs.apply_xfm) and self.inputs.apply_xfm:
566-
if not self.inputs.in_matrix_file or not self.inputs.uses_qform:
566+
if not self.inputs.in_matrix_file and not self.inputs.uses_qform:
567567
raise RuntimeError('Argument apply_xfm requires in_matrix_file '
568568
'or uses_qform arguments to run')
569569
skip.append('save_log')

nipype/interfaces/fsl/tests/test_preprocess.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,14 @@ def test_flirt(setup_flirt):
227227
flirter.cmdline
228228
flirter.inputs.reference = reffile
229229

230+
# Generate outfile and outmatrix
231+
pth, fname, ext = split_filename(infile)
232+
outfile = fsl_name(flirter, '%s_flirt' % fname)
233+
outmat = '%s_flirt.mat' % fname
234+
realcmd = 'flirt -in %s -ref %s -out %s -omat %s' % (infile, reffile,
235+
outfile, outmat)
236+
assert flirter.cmdline == realcmd
237+
230238
# test apply_xfm option
231239
axfm = flirter
232240
axfm.inputs.apply_xfm = True
@@ -235,20 +243,11 @@ def test_flirt(setup_flirt):
235243
axfm2 = axfm
236244
# test uses_qform
237245
axfm.inputs.uses_qform = True
238-
assert axfm.cmdline == ('flirt -in %s -ref %s -applyxfm -usesqform' % (
239-
infile, reffile))
246+
assert axfm.cmdline == (realcmd + ' -applyxfm -usesqform')
240247
# test in_matrix_file
241248
axfm2.inputs.in_matrix_file = reffile
242-
assert axfm2.cmdline == ('flirt -in %s -ref %s -applyxfm -init %s' % (
243-
infile, reffile, reffile))
249+
assert axfm2.cmdline == (realcmd + ' -applyxfm -init %s' % reffile)
244250

245-
# Generate outfile and outmatrix
246-
pth, fname, ext = split_filename(infile)
247-
outfile = fsl_name(flirter, '%s_flirt' % fname)
248-
outmat = '%s_flirt.mat' % fname
249-
realcmd = 'flirt -in %s -ref %s -out %s -omat %s' % (infile, reffile,
250-
outfile, outmat)
251-
assert flirter.cmdline == realcmd
252251

253252
_, tmpfile = tempfile.mkstemp(suffix='.nii', dir=tmpdir)
254253
# Loop over all inputs, set a reasonable value and make sure the

0 commit comments

Comments
 (0)