code: def get_relative_corners(spatial_rank):
      """
      compute relative corners of the spatially n-d tensor::
  
          1-D: [[-1], [1]]
          2-D: [[-1, -1], [-1, 1], [1, -1], [1, 1]]
          3-D: [[-1, -1, -1], [-1, -1, 1],
                [-1, 1, -1],  [-1, 1, 1],
                [1, -1, -1],  [1, -1, 1],
                [1, 1, -1],   [1, 1, 1]]
  
      :param spatial_rank: integer of number of spatial dimensions
      :return: [2**spatial_rank, spatial_rank] matrix
      """
      return [
          [int(c) * 2.0 - 1.0 for c in format(i, "0%ib" % spatial_rank)]
          for i in range(2**spatial_rank)
      ]
  
file_path: NiftyNet/niftynet/layer/affine_augmentation.py
imports: from __future__ import absolute_import, print_function
  import tensorflow
  from niftynet.layer.base_layer import Layer
  from niftynet.layer.grid_warper import AffineGridWarperLayer
  from niftynet.layer.layer_util import infer_spatial_rank
  from niftynet.layer.resampler import ResamplerLayer
label_desc: Use image node_id 1 for calling a global function with example usage: get_relative_corners(spatial_rank) and returns: unknown