code: def test_image_grid_domain():
      """Test the construction of grid domain based on image"""
      toto = np.ones(shape[:3])
      affine = np.random.randn(4, 4)
      affine[3:, 0:3] = 0
      nim = Nifti1Image(toto, affine)
      ddom = grid_domain_from_image(nim)
      ref = np.sum(toto) * np.absolute(np.linalg.det(affine[:3, 0:3]))
      assert_almost_equal(np.sum(ddom.local_volume), ref)
  
imports: import nibabel.gifti
  import numpy
  from nibabel import Nifti1Image
  from numpy.testing import assert_almost_equal, assert_array_equal
  from ..discrete_domain import domain_from_binary_array, domain_from_image, domain_from_mesh, grid_domain_from_binary_array, grid_domain_from_image, grid_domain_from_shape, smatrix_from_3d_array, smatrix_from_nd_array, smatrix_from_nd_idx
label_desc: Use image node_id 14 for calling a global function with example usage: test_image_grid_domain() without return types