code: def test_nonaffine():
      # resamples an image along a curve through the image.
      #
      # FIXME: use the reference.evaluate.Grid to perform this nicer
      def curve(x):  # function accept N by 1, returns N by 2
          return np.vstack([5 * np.sin(x.T), 5 * np.cos(x.T)]).T + [
              52,
              47,
          ]
  
      for names in (("xy", "ij", "t", "u"), ("ij", "xy", "t", "s")):
          in_names, out_names, tin_names, tout_names = names
          g = AffineTransform.from_params(
              in_names, out_names, np.identity(3)
          )
          img = Image(np.ones((100, 90)), g)
          img.get_fdata()[50:55, 40:55] = 3.0
          tcoordmap = AffineTransform.from_start_step(
              tin_names, tout_names, [0], [np.pi * 1.8 / 100]
          )
          ir = resample(img, tcoordmap, curve, (100,))
      if gui_review:
          import matplotlib.pyplot as plt
  
          plt.figure(num=3)
          plt.imshow(img, interpolation="nearest")
          d = curve(np.linspace(0, 1.8 * np.pi, 100))
          plt.plot(d[0], d[1])
          plt.gca().set_ylim([0, 99])
          plt.gca().set_xlim([0, 89])
          plt.figure(num=4)
          plt.plot(ir.get_fdata())
  
imports: from itertools import product
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from nipy.algorithms.resample import resample, resample_img2img
  from nipy.core.api import AffineTransform, ArrayCoordMap, Image, vox2mni
  from nipy.core.reference import slices
  from nipy.io.api import load_image
  from nipy.testing import anatfile, funcfile
label_desc: Use image node_id 12 for calling a global function with example usage: test_nonaffine() and returns: unknown