code: def train(self, image_list):
      # check modalities to train, using the first subject in subject list
      # to find input modality list
      assert (
          image_list is not None
      ), "nothing to training for this layer"
      if self.is_ready():
          tf.logging.info(
              "label mapping ready for {}:{}, {} classes".format(
                  self.image_name,
                  self.modalities,
                  len(self.label_map[self.key[0]]),
              )
          )
          return
      tf.logging.info(
          "Looking for the set of unique discrete labels from input {}"
          " using {} subjects".format(self.image_name, len(image_list))
      )
      label_map = find_set_of_labels(
          image_list, self.image_name, self.key
      )
      # merging trained_mapping dict and self.mapping dict
      self.label_map.update(label_map)
      all_maps = hs.read_mapping_file(self.model_file)
      all_maps.update(self.label_map)
      hs.write_all_mod_mapping(self.model_file, all_maps)
  
file_path: NiftyNet/niftynet/layer/discrete_label_normalisation.py
imports: from __future__ import absolute_import, print_function, division
  import os
  import numpy
  import tensorflow
  import niftynet.utilities.histogram_standardisation
  from niftynet.layer.base_layer import DataDependentLayer
  from niftynet.layer.base_layer import Invertible
  from niftynet.utilities.user_parameters_helper import standardise_string
  from niftynet.utilities.util_common import print_progress_bar
label_desc: Use image node_id 7 for calling the DiscreteLabelNormalisationLayer obj's underlying member method code with example usage: obj.train(image_list) without return types