code: def test_funny_coordmap():
      # 5x4 affine should also work, and give same answer as 4x4
      func = load_image(funcfile)
      cmap = func.coordmap
      # Give the affine a rotation
      aff = np.eye(5)
      aff[:3, :3] = euler2mat(0.3, 0.2, 0.1)
      cmap_rot = AffineTransform(
          cmap.function_range, cmap.function_range, aff
      )
      func_rot = Image(func.get_fdata(), compose(cmap_rot, cmap))
      func1 = func_rot[..., 1]  # 5x4 affine
      smoother = LinearFilter(func1.coordmap, func1.shape)
      sfunc1 = smoother.smooth(func1)  # OK
      # And same as for 4x4 affine
      cmap3d = drop_io_dim(cmap, "t")
      func3d = Image(func1.get_fdata(), cmap3d)
      smoother = LinearFilter(func3d.coordmap, func3d.shape)
      sfunc3d = smoother.smooth(func3d)
      assert sfunc1.shape == sfunc3d.shape
      assert_array_almost_equal(sfunc1.get_fdata(), sfunc3d.get_fdata())
      # And same with no rotation
      func_fresh = func[..., 1]  # 5x4 affine, no rotation
      smoother = LinearFilter(func_fresh.coordmap, func_fresh.shape)
      sfunc_fresh = smoother.smooth(func_fresh)
      assert sfunc1.shape == sfunc_fresh.shape
      assert_array_almost_equal(
          sfunc1.get_fdata(), sfunc_fresh.get_fdata()
      )
  
file_path: nipy/nipy/algorithms/tests/test_kernel_smooth.py
imports: import numpy
  import pytest
  from numpy.random import randint
  from numpy.testing import assert_array_almost_equal
  from transforms3d.taitbryan import euler2mat
  from ...None import load_image
  from ...core.api import AffineTransform, Image, compose, drop_io_dim
  from ...testing import anatfile, funcfile
  from ..kernel_smooth import LinearFilter, fwhm2sigma, sigma2fwhm
label_desc: Use image node_id 2 for calling a global function with example usage: test_funny_coordmap() without return types