code: def label_remap(label, map_dict=None):
      """
      Convert labels using label map
  
      label: 3D numpy/cupy array in [z, y, x] order.
      map_dict: the label transfer map dict. key is the original label, value is the remaped one.
      """
  
      if not isinstance(label, np.ndarray):
          image = np.array(label)
  
      for key, val in map_dict.items():
          label[label == key] = val
  
      return label
  
imports: import sys
  import os
  import tools.preprocess_utils.global_var
label_desc: Use image node_id 1 for calling a global function with example usage: label_remap(label, map_dict) and returns: label