Skip to content

Commit 1156e3c

Browse files
committed
tst: updated flirt test
1 parent a320cc5 commit 1156e3c

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

nipype/interfaces/fsl/tests/test_preprocess.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,28 @@ def test_flirt(setup_flirt):
220220
flirter = fsl.FLIRT()
221221
# infile not specified
222222
with pytest.raises(ValueError):
223-
flirter.run()
223+
flirter.cmdline
224224
flirter.inputs.in_file = infile
225225
# reference not specified
226226
with pytest.raises(ValueError):
227-
flirter.run()
227+
flirter.cmdline
228228
flirter.inputs.reference = reffile
229+
230+
# test apply_xfm option
231+
axfm = flirter
232+
axfm.inputs.apply_xfm = True
233+
# in_matrix_file or uses_qform must be defined
234+
with pytest.raises(RuntimeError): axfm.cmdline
235+
axfm2 = axfm
236+
# test uses_qform
237+
axfm.inputs.uses_qform = True
238+
assert axfm.cmdline == ('flirt -in %s -ref %s -applyxfm -usesqform' % (
239+
infile, reffile))
240+
# test in_matrix_file
241+
axfm2.inputs.in_matrix_file = reffile
242+
assert axfm2.cmdline == ('flirt -in %s -ref %s -applyxfm -init %s' % (
243+
infile, reffile, reffile))
244+
229245
# Generate outfile and outmatrix
230246
pth, fname, ext = split_filename(infile)
231247
outfile = fsl_name(flirter, '%s_flirt' % fname)

0 commit comments

Comments
 (0)