code: def load_image_obj(filename, loader=None):
      """
      Loads an image from a given loader or checking multiple loaders.
  
      If `loader` is specified the selected loader will be used if it exists in
      `AVAILABLE_LOADERS` (see above).
  
      If no loader is specified, all the loaders registered with
      `auto_discover=True` (default) will be looped in priority order.
      """
      if loader and loader in SUPPORTED_LOADERS:
          if loader not in AVAILABLE_LOADERS:
              raise ValueError(
                  "Image Loader {} supported but library not found."
                  " Required libraries: {}".format(
                      loader, SUPPORTED_LOADERS[loader]
                  )
              )
          tf.logging.debug("Using requested loader: {}".format(loader))
          loader_params = AVAILABLE_LOADERS[loader]
          return loader_params["func"](filename)
      if loader:
          raise ValueError(
              "Image Loader {} not supported. Supported loaders: {}".format(
                  loader, list(SUPPORTED_LOADERS.keys())
              )
          )
  
      for name, loader_params in AVAILABLE_LOADERS.items():
          if not loader_params["auto_discover"]:
              continue
  
          try:
              img = loader_params["func"](filename)
              tf.logging.debug("Using Image Loader {}.".format(name))
              return img
          except IOError:
              # e.g. Nibabel cannot load standard 2D images
              # e.g. PIL cannot load 16bit TIF images
              pass
  
      raise ValueError(
          "No available loader could load file: {}."
          " Available loaders: {}. Supported Loaders: {}".format(
              filename,
              list(AVAILABLE_LOADERS.keys()),
              list(SUPPORTED_LOADERS.keys()),
          )
      )
  
file_path: NiftyNet/niftynet/io/image_loader.py
imports: from collections import OrderedDict
  import nibabel
  import numpy
  import tensorflow
  from niftynet.utilities.util_import import require_module
label_desc: Use image node_id 2 for calling a global function with example usage: load_image_obj(filename, loader) and returns: loader_params, img