code: def test_mrisexpand(tmpdir):
      fssrc = FreeSurferSource(
          subjects_dir=fs.Info.subjectsdir(),
          subject_id="fsaverage",
          hemi="lh",
      )
  
      fsavginfo = fssrc.run().outputs.get()
  
      # dt=60 to ensure very short runtime
      expand_if = fs.MRIsExpand(
          in_file=fsavginfo["smoothwm"],
          out_name="expandtmp",
          distance=1,
          dt=60,
      )
  
      expand_nd = pe.Node(
          fs.MRIsExpand(
              in_file=fsavginfo["smoothwm"],
              out_name="expandtmp",
              distance=1,
              dt=60,
          ),
          name="expand_node",
      )
  
      # Interfaces should have same command line at instantiation
      orig_cmdline = "mris_expand -T 60 {} 1 expandtmp".format(
          fsavginfo["smoothwm"]
      )
      assert expand_if.cmdline == orig_cmdline
      assert expand_nd.interface.cmdline == orig_cmdline
  
      # Run Node interface
      nd_res = expand_nd.run()
  
      # Commandlines differ
      node_cmdline = (
          "mris_expand -T 60 -pial {cwd}/lh.pial {cwd}/lh.smoothwm "
          "1 expandtmp".format(cwd=nd_res.runtime.cwd)
      )
      assert nd_res.runtime.cmdline == node_cmdline
  
      # Check output
      if_out_file = expand_if._list_outputs()["out_file"]
      nd_out_file = nd_res.outputs.get()["out_file"]
      # Same filename
      assert op.basename(if_out_file) == op.basename(nd_out_file)
      # Interface places output in source directory
      assert op.dirname(if_out_file) == op.dirname(
          fsavginfo["smoothwm"]
      )
      # Node places output in working directory
      assert op.dirname(nd_out_file) == nd_res.runtime.cwd
  
file_path: nipype/nipype/interfaces/freesurfer/tests/test_utils.py
imports: import os
  import os.path
  import pytest
  from nipype.testing.fixtures import create_files_in_directory_plus_dummy_file, create_surf_file_in_directory
  from nipype.pipeline import engine
  from nipype.interfaces import freesurfer
  from nipype.interfaces.base import TraitError
  from nipype.interfaces.io import FreeSurferSource
label_desc: Use image node_id 5 for calling a global function with example usage: test_mrisexpand(tmpdir) without return types