code: def test_3d_flip(self):
      a = np.zeros(24).reshape(2, 3, 4)
      a[0, 0, 0] = 1
      flip_layer = RandomFlipLayer(
          flip_axes=[0, 1, 2], flip_probability=1
      )
      flip_layer.randomise(spatial_rank=3)
      transformed_a = flip_layer._apply_transformation(a)
      with self.cached_session() as sess:
          # cube of zeros with opposite corner as 1
          expected_a = np.zeros(24).reshape(2, 3, 4)
          expected_a[-1, -1, -1] = 1
          self.assertTrue(np.array_equal(transformed_a, expected_a))
  
file_path: NiftyNet/tests/rand_flip_test.py
imports: from __future__ import absolute_import, print_function
  import os
  import numpy
  import tensorflow
  from niftynet.layer.rand_flip import RandomFlipLayer
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 3 for calling the RandFlipTest obj's underlying member method code with example usage: obj.test_3d_flip() without return types