code: def test_coordinates(self):
      coords = grid_spatial_coordinates(
          subject_id=1,
          img_sizes={
              "image": (64, 64, 64, 1, 2),
              "label": (42, 42, 42, 1, 1),
          },
          win_sizes={"image": (63, 63, 40), "label": (42, 41, 33)},
          border_size=(2, 3, 4),
      )
      # first dim corresponds to subject id
      expected_image = np.array(
          [
              [1, 0, 0, 0, 63, 63, 40],
              [1, 0, 0, 24, 63, 63, 64],
              [1, 0, 0, 12, 63, 63, 52],
              [1, 1, 0, 0, 64, 63, 40],
              [1, 1, 0, 24, 64, 63, 64],
              [1, 1, 0, 12, 64, 63, 52],
              [1, 0, 1, 0, 63, 64, 40],
              [1, 0, 1, 24, 63, 64, 64],
              [1, 0, 1, 12, 63, 64, 52],
              [1, 1, 1, 0, 64, 64, 40],
              [1, 1, 1, 24, 64, 64, 64],
              [1, 1, 1, 12, 64, 64, 52],
          ],
          dtype=np.int32,
      )
      self.assertAllClose(coords["image"], expected_image)
      expected_label = np.array(
          [
              [1, 0, 0, 0, 42, 41, 33],
              [1, 0, 0, 9, 42, 41, 42],
              [1, 0, 0, 4, 42, 41, 37],
              [1, 0, 1, 0, 42, 42, 33],
              [1, 0, 1, 9, 42, 42, 42],
              [1, 0, 1, 4, 42, 42, 37],
          ],
          dtype=np.int32,
      )
      self.assertAllClose(coords["label"], expected_label)
      pass
  
imports: from __future__ import absolute_import, division, print_function
  import os
  import numpy
  import tensorflow
  from niftynet.engine.sampler_grid_v2 import GridSampler, _enumerate_step_points, grid_spatial_coordinates
  from niftynet.io.image_reader import ImageReader
  from niftynet.io.image_sets_partitioner import ImageSetsPartitioner
  from niftynet.utilities.util_common import ParserNamespace
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 1 for calling the CoordinatesTest obj's underlying member method code with example usage: obj.test_coordinates() without return types