code: def test_3d_shape(self):
      augment_layer = AffineAugmentationLayer(0.2)
      input_tensor = self.get_3d_image()
      deformed = augment_layer(input_tensor)
  
      inverse_augment_layer = augment_layer.inverse()
      inverse = inverse_augment_layer(deformed)
  
      # with tf.Session() as sess:
      with self.cached_session() as sess:
          test_out = sess.run([input_tensor, deformed, inverse])
          original, deformed_image, resumed_image = test_out
          to_compare = resumed_image > 0
          original = original[to_compare]
          resumed_image = resumed_image[to_compare]
  
          correct = np.sum(np.abs(original - resumed_image) < 1.0)
          ratio = float(correct) / float(original.size)
          print(ratio)
          self.assertGreaterEqual(ratio, 0.95)
  
file_path: NiftyNet/tests/affine_augmentation_test.py
imports: from __future__ import absolute_import, print_function
  import numpy
  import tensorflow
  from niftynet.layer.affine_augmentation import AffineAugmentationLayer
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 4 for calling the RandRotationTest obj's underlying member method code with example usage: obj.test_3d_shape() without return types