code: def test_resample2d2():
      g = AffineTransform.from_params(
          "ij", "xy", np.diag([0.5, 0.5, 1])
      )
      i = Image(np.ones((100, 90)), g)
      i.get_fdata()[50:55, 40:55] = 3.0
      a = np.identity(3)
      a[:2, -1] = 4.0
      A = np.identity(2)
      b = np.ones(2) * 4
      ir = resample(i, i.coordmap, (A, b), (100, 90))
      assert_array_almost_equal(ir.get_fdata()[42:47, 32:47], 3.0)
  
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 8 for calling a global function with example usage: test_resample2d2() without return types