code: def test_trivial_grid():
      """Test resampling for an grid embedded in world space with an
      identity transform.
      """
      N = 10
      identity = Transform("voxels", "world", id, id)
      data = np.random.random((N, N, N))
      img = VolumeGrid(
          data=data,
          transform=identity,
      )
      x, y, z = np.random.randint(1, N + 1, size=(3, 10)) - 1
      data_ = img.values_in_world(x, y, z)
      # Check that passing in arrays with different shapes raises an error
      pytest.raises(ValueError, img.values_in_world, x, y, z[:-1])
      # Check that passing in wrong interpolation keyword raises an error
      pytest.raises(ValueError, img.values_in_world, 0, 0, 0, "e")
      np.testing.assert_almost_equal(data[x, y, z], data_)
  
file_path: nipy/nipy/labs/datasets/volumes/tests/test_volume_grid.py
imports: import copy
  import numpy
  import pytest
  from ...transforms.transform import CompositionError, Transform
  from ..volume_grid import VolumeGrid
  from ..volume_img import VolumeImg
label_desc: Use image node_id 6 for calling a global function with example usage: test_trivial_grid() without return types