code: def _as_fname(img):
      global _counter
      fname = "img%3d.nii" % _counter
      _counter = _counter + 1
      save(img, fname)
      return fname
  
file_path: nibabel/nibabel/tests/test_funcs.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ..analyze import AnalyzeImage
  from ..funcs import OrientationError, as_closest_canonical, concat_images
  from ..loadsave import save
  from ..nifti1 import Nifti1Image
  from ..tmpdirs import InTemporaryDirectory
label_desc: Use image node_id 1 for calling a global function with example usage: _as_fname(img) and returns: fname