code: def test_rotate3d():
      # Rotate / transpose a 3d image on a non-square grid
      g = AffineTransform.from_params(
          "ijk", "xyz", np.diag([0.5, 0.6, 0.7, 1])
      )
      g2 = AffineTransform.from_params(
          "ijk", "xyz", np.diag([0.5, 0.7, 0.6, 1])
      )
      shape = (100, 90, 80)
      i = Image(np.ones(shape), g)
      i.get_fdata()[50:55, 40:55, 30:33] = 3.0
      a = np.array(
          [[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1.0]]
      )
      ir = resample(i, g2, a, (100, 80, 90))
      assert_array_almost_equal(
          np.transpose(ir.get_fdata(), (0, 2, 1)), i.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 5 for calling a global function with example usage: test_rotate3d() without return types