code: def test_simple_inverse(self):
      expected_grid = np.array(
          [
              [
                  [[0.38, 0.08], [-0.02, 0.68], [-0.42, 1.28]],
                  [[0.98, -0.32], [0.58, 0.28], [0.18, 0.88]],
                  [[1.58, -0.72], [1.18, -0.12], [0.78, 0.48]],
              ]
          ],
          dtype=np.float32,
      )
  
      inverse_grid = AffineGridWarperLayer(
          source_shape=(3, 3), output_shape=(2, 2)
      ).inverse_op()
      aff = tf.constant([[1.5, 1.0, 0.2, 1.0, 1.5, 0.5]])
      output = inverse_grid(aff)
      with self.cached_session() as sess:
          out_val = sess.run(output)
      self.assertAllClose(out_val, expected_grid)
  
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 1 for calling the AffineGridWarperInvLayerTest obj's underlying member method code with example usage: obj.test_simple_inverse() without return types