code: def overlay_labels(
      pixel_data, labels, opacity=0.7, max_label=None, seed=None
  ):
      colors = _colors(labels, max_label=max_label, seed=seed)
  
      if labels.ndim == 3:
          overlay = numpy.zeros(
              labels.shape + (3,), dtype=numpy.float32
          )
  
          for index, plane in enumerate(pixel_data):
              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=pixel_data,
      )
  
imports: import matplotlib.cm
  import numpy
  import skimage.color
  from ...preferences import get_default_colormap
label_desc: Use image node_id 3 for calling a global function with example usage: overlay_labels(pixel_data, labels, opacity, max_label, seed) and returns: skimage, overlay