code: def test_apply_transform():
      moving = example_data(infile="functional.nii")
      mat = example_data(infile="trans.mat")
      applymat = spmu.ApplyTransform(matlab_cmd="mymatlab")
      assert applymat.inputs.matlab_cmd == "mymatlab"
      applymat.inputs.in_file = moving
      applymat.inputs.mat = mat
      script = applymat._make_matlab_command(None)
      expected = "[p n e v] = spm_fileparts(V.fname);"
      assert expected in script
      expected = "V.mat = transform.M * V.mat;"
      assert expected in script
  
file_path: nipype/nipype/interfaces/spm/tests/test_utils.py
imports: import os
  import pytest
  from nipype.testing import example_data
  import nipype.interfaces.spm.utils
  from nipype.interfaces.base import isdefined
  from nipype.utils.filemanip import split_filename, fname_presuffix
  from nipype.interfaces.base import TraitError
label_desc: Use image node_id 2 for calling a global function with example usage: test_apply_transform() without return types