code: def read_mapping_file(mapping_file):
      """
      Reads an existing mapping file with the given modalities.
      :param mapping_file: file in which mapping is stored
      :return mapping_dict: dictionary containing the mapping landmarks for
      each modality stated in the mapping file
      """
      mapping_dict = {}
      if not mapping_file:
          return mapping_dict
      if not os.path.isfile(mapping_file):
          return mapping_dict
  
      with open(mapping_file, "r") as f:
          for line in f:
              if len(line) <= 2:
                  continue
              line = line.split()
              if len(line) < 2:
                  continue
              try:
                  map_name, map_value = line[0], np.float32(line[1:])
                  mapping_dict[map_name] = tuple(map_value)
              except ValueError:
                  tf.logging.fatal(
                      "unknown input format: {}".format(mapping_file)
                  )
                  raise
      return mapping_dict
  
file_path: NiftyNet/niftynet/utilities/histogram_standardisation.py
imports: from __future__ import absolute_import, print_function, division
  import os
  import numpy
  import numpy.ma
  import tensorflow
  from niftynet.io.misc_io import touch_folder
  from niftynet.utilities.util_common import look_up_operations, print_progress_bar
label_desc: Use image node_id 8 for calling a global function with example usage: read_mapping_file(mapping_file) and returns: mapping_dict, mapping_dict, mapping_dict