code: def generate_2d_images():
      # Test 2D Image Loader
  
      # Generate 10 fake 2d grayscale and color images of size 100x100
      img_path = os.path.join(
          os.path.dirname(__file__), "..", "testing_data"
      )
      img_path = os.path.realpath(os.path.join(img_path, "images2d"))
      if not os.path.isdir(img_path):
          os.makedirs(img_path)
  
      # Generate fake testing data
      for i in range(10):
          img1 = np.random.randint(0, 255, size=(100, 100, 3)).astype(
              np.uint8
          )
          gray = np.random.randint(0, 255, size=(100, 100)).astype(
              np.uint8
          )
          mask = ((gray > SEG_THRESHOLD) * 255).astype(np.uint8)
          Image.fromarray(img1).save(
              os.path.join(img_path, "img%d_u.png" % i)
          )
          Image.fromarray(gray).save(
              os.path.join(img_path, "img%d_g.png" % i)
          )
          Image.fromarray(mask).save(
              os.path.join(img_path, "img%d_m.png" % i)
          )
      return
  
imports: from __future__ import absolute_import, print_function
  import os
  from PIL import Image
  import nibabel
  import numpy
  import tensorflow
  from niftynet.io.image_reader import ImageReader
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 1 for calling a global function with example usage: generate_2d_images() without return types