code: def test_3d(self):
      aff = tf.constant(
          [[2, 0, 0, 5, 0, 2, 0, 6, 0, 0, 1, 4]], dtype=tf.float32
      )
      params = {"source_shape": (3, 3, 3), "output_shape": (2, 2, 2)}
      expected = [
          [
              [[[4, 5, 4], [4, 5, 6]], [[4, 9, 4], [4, 9, 6]]],
              [[[8, 5, 4], [8, 5, 6]], [[8, 9, 4], [8, 9, 6]]],
          ]
      ]
      self._test_correctness(params, aff, expected)
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import tensorflow
  from niftynet.layer.grid_warper import AffineGridWarperLayer
  from niftynet.layer.grid_warper import AffineWarpConstraints
  from niftynet.layer.grid_warper import _create_affine_features
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 5 for calling the AffineGridWarperLayerTest obj's underlying member method code with example usage: obj.test_3d() without return types