code: def test_resample3d():
      g = AffineTransform.from_params(
          "ijk", "xyz", np.diag([0.5, 0.5, 0.5, 1])
      )
      shape = (100, 90, 80)
      i = Image(np.ones(shape), g)
      i.get_fdata()[50:55, 40:55, 30:33] = 3.0
      # This mapping describes a mapping from the "target" physical
      # coordinates to the "image" physical coordinates.  The 4x4 matrix
      # below indicates that the "target" physical coordinates are related
      # to the "image" physical coordinates by a shift of -4 in each
      # coordinate.  Or, to find the "image" physical coordinates, given
      # the "target" physical coordinates, we add 4 to each "target
      # coordinate".  The resulting resampled image should show the
      # overall image shifted [-6,-8,-10] voxels towards the origin
      a = np.identity(4)
      a[:3, -1] = [3, 4, 5]
      ir = resample(i, i.coordmap, a, (100, 90, 80))
      assert_array_almost_equal(
          ir.get_fdata()[44:49, 32:47, 20:23], 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 10 for calling a global function with example usage: test_resample3d() without return types