code: def test_convertxfm(create_files_in_directory_plus_output_type):
      filelist, outdir, _ = create_files_in_directory_plus_output_type
      cvt = fsl.ConvertXFM()
  
      # make sure command gets called
      assert cvt.cmd == "convert_xfm"
  
      # test raising error with mandatory args absent
      with pytest.raises(ValueError):
          cvt.run()
  
      # .inputs based parameters setting
      cvt.inputs.in_file = filelist[0]
      cvt.inputs.invert_xfm = True
      cvt.inputs.out_file = "foo.mat"
      assert (
          cvt.cmdline
          == "convert_xfm -omat foo.mat -inverse %s" % filelist[0]
      )
  
      # constructor based parameter setting
      cvt2 = fsl.ConvertXFM(
          in_file=filelist[0],
          in_file2=filelist[1],
          concat_xfm=True,
          out_file="bar.mat",
      )
      assert (
          cvt2.cmdline
          == "convert_xfm -omat bar.mat -concat {} {}".format(
              filelist[1],
              filelist[0],
          )
      )
  
file_path: nipype/nipype/interfaces/fsl/tests/test_utils.py
imports: import os
  import numpy
  import nibabel
  import pytest
  import nipype.interfaces.fsl.utils
  from nipype.interfaces.fsl import no_fsl, Info
  from nipype.testing.fixtures import create_files_in_directory_plus_output_type
label_desc: Use image node_id 9 for calling a global function with example usage: test_convertxfm(create_files_in_directory_plus_output_type) without return types