docstr: Show an informative display
docstr_tok: ["Show","an","informative","display"]
code: def display(self, workspace, figure):
      """Show an informative display"""
      import matplotlib
      import cellprofiler.gui.figure
  
      figure.set_subplots((2, 1))
      assert isinstance(figure, cellprofiler.gui.figure.Figure)
  
      i = workspace.display_data.i
      j = workspace.display_data.j
      angles = workspace.display_data.angle
      mask = workspace.display_data.mask
      labels = workspace.display_data.labels
      count = workspace.display_data.count
  
      color_image = numpy.zeros((mask.shape[0], mask.shape[1], 4))
      #
      # We do the coloring using alpha values to let the different
      # things we draw meld together.
      #
      # The binary mask is white.
      #
      color_image[mask, :] = MASK_ALPHA
      if count > 0:
          mappable = matplotlib.cm.ScalarMappable(
              cmap=matplotlib.cm.get_cmap(get_default_colormap())
          )
          numpy.random.seed(0)
          colors = mappable.to_rgba(
              numpy.random.permutation(numpy.arange(count))
          )
  
          #
          # The labels
          #
          color_image[labels > 0, :] += (
              colors[labels[labels > 0] - 1, :] * LABEL_ALPHA
          )
          #
          # Do each diamond individually (because the angles are almost certainly
          # different for each
          #
          lcolors = colors * 0.5 + 0.5  # Wash the colors out a little
          for ii in range(count):
              diamond = self.get_diamond(angles[ii])
              hshape = ((numpy.array(diamond.shape) - 1) / 2).astype(
                  int
              )
              iii = int(i[ii])
              jjj = int(j[ii])
              color_image[
                  iii - hshape[0] : iii + hshape[0] + 1,
                  jjj - hshape[1] : jjj + hshape[1] + 1,
                  :,
              ][diamond, :] += (
                  lcolors[ii, :] * WORM_ALPHA
              )
      #
      # Do our own alpha-normalization
      #
      color_image[:, :, -1][color_image[:, :, -1] == 0] = 1
      color_image[:, :, :-1] = (
          color_image[:, :, :-1]
          / color_image[:, :, -1][:, :, numpy.newaxis]
      )
      plot00 = figure.subplot_imshow_bw(
          0, 0, mask, self.image_name.value
      )
      figure.subplot_imshow_color(
          1,
          0,
          color_image[:, :, :-1],
          title=self.object_name.value,
          normalize=False,
          sharexy=plot00,
      )
  
imports: import matplotlib.cm
  import numpy
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER, M_LOCATION_CENTER_X, M_LOCATION_CENTER_Y, M_NUMBER_OBJECT_NUMBER, FF_COUNT, COLTYPE_FLOAT, IMAGE, C_COUNT, C_LOCATION, C_NUMBER, FTR_CENTER_X, FTR_CENTER_Y, FTR_OBJECT_NUMBER
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.module import Module
  from cellprofiler_core.object import Objects, ObjectSet
  from cellprofiler_core.preferences import get_default_colormap
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.text import LabelName, Integer, Float
  from centrosome.cpmorphology import all_connected_components
  from centrosome.cpmorphology import fixup_scipy_ndimage_result
  from centrosome.cpmorphology import get_line_pts
  from scipy.ndimage import binary_erosion, binary_fill_holes
  from scipy.ndimage import mean
label_desc: Use image node_id 5 for calling the IdentifyDeadWorms obj's underlying member method code with example usage: obj.display(workspace, figure) without return types