code: def overlay_objects(
      image,
      labels,
      opacity=0.3,
      max_label=None,
      seed=None,
      colormap="jet",
  ):
      cmap = matplotlib.cm.ScalarMappable(
          cmap=matplotlib.cm.get_cmap(colormap)
      )
  
      colors = cmap.to_rgba(
          numpy.arange(labels.max() if max_label is None else max_label)
      )[:, :3]
  
      if seed is not None:
          # Resetting the random seed helps keep object label colors consistent in displays
          # where consistency is important, like RelateObjects.
          numpy.random.seed(seed)
  
      numpy.random.shuffle(colors)
  
      if labels.ndim == 3:
          overlay = numpy.zeros(
              labels.shape + (3,), dtype=numpy.float32
          )
  
          for index, plane in enumerate(image):
              unique_labels = numpy.unique(labels[index])
  
              if unique_labels[0] == 0:
                  unique_labels = unique_labels[1:]
  
              overlay[index] = skimage.color.label2rgb(
                  labels[index],
                  alpha=opacity,
                  bg_color=[0, 0, 0],
                  bg_label=0,
                  colors=colors[unique_labels - 1],
                  image=plane,
              )
  
          return overlay
  
      return skimage.color.label2rgb(
          labels,
          alpha=opacity,
          bg_color=[0, 0, 0],
          bg_label=0,
          colors=colors,
          image=image,
      )
  
imports: import numpy
  import skimage.color
  import skimage.morphology
  import centrosome
  import centrosome.threshold
  import scipy
  import matplotlib
label_desc: Use image node_id 17 for calling a global function with example usage: overlay_objects(image, labels, opacity, max_label, seed, colormap) and returns: skimage, overlay