code: def image_call(img, function, inaxis="t", outaxis="new"):
      """
      Take an Image, perform some operation on it, over a specified axis, and
      return a new Image.
  
      For the sake of testing things out, we will assume that the operation can
      only operate on the first axis of the array.
  
      Parameters
      ----------
      img : Image
      function : callable
          An operation that does something over the first axis,
          such as lambda x: x[::2]
      inaxis : str or int
          Specification of axis of Image
      outaxis : str
          Name of new axis in new Image
  
      Returns
      -------
      newim : Image
          with axis `inaxis` replaced with `outaxis`
      """
      rolled_img = rollimg(img, inaxis)
      inaxis = rolled_img.axes.coord_names[0]  # now it's a string
      newdata = function(rolled_img.get_fdata())
      new_coordmap = rolled_img.coordmap.renamed_domain(
          {inaxis: outaxis}
      )
      new_image = Image(newdata, new_coordmap)
      # we have to roll the axis back
      axis_index = img.axes.index(inaxis) + 1
      return rollimg(new_image, 0, axis_index)
  
file_path: nipy/nipy/core/image/tests/test_rollimg.py
imports: import numpy
  import pytest
  from numpy.testing import assert_almost_equal, assert_array_equal
  from ...image.image_spaces import xyz_affine
  from ...reference.coordinate_map import AffineTransform
  from ...reference.coordinate_map import AxisError, drop_io_dim
  from ...reference.coordinate_system import CoordinateSystem
  from ...reference.spaces import mni_csm
  from ..image import Image, rollimg, synchronized_order
label_desc: Use image node_id 3 for calling a global function with example usage: image_call(img, function, inaxis, outaxis) and returns: rollimg