code: def fname_presuffix(fname, prefix="", suffix="", use_ext=True):
      pth, fname = os.path.split(fname)
      fname, ext = os.path.splitext(fname)
      if not use_ext:
          ext = ""
      return os.path.join(pth, prefix + fname + suffix + ext)
  
file_path: nipy/nipy/interfaces/spm.py
imports: import os
  import numpy
  from nibabel import load
  from nibabel.tmpdirs import InTemporaryDirectory
  from scipy.io import savemat
  from .matlab import run_matlab_script
label_desc: Use image node_id 6 for calling a global function with example usage: fname_presuffix(fname, prefix, suffix, use_ext) and returns: os