code: def add_heatmap(self):
      group = SettingsGroup()
  
      if len(self.heatmaps) > 0:
          group.append("divider", Divider(line=False))
  
      group.append(
          "image_name",
          MORDImageNameSubscriber(
              "Image",
              doc="""\
  The heatmap will be displayed with measurements taken using this image. The setting will let you
  choose from among the images you have specified in "Select image to measure".
  """,
          ),
      )
  
      group.image_name.set_module(self)
  
      group.append(
          "object_name",
          MORDObjectNameSubscriber(
              "Objects to display",
              doc="""\
  The objects to display in the heatmap. You can select any of the
  objects chosen in "Select objects to measure".""",
          ),
      )
  
      group.object_name.set_module(self)
  
      group.append(
          "bin_count",
          Choice(
              "Number of bins",
              self.get_bin_count_choices(),
              choices_fn=self.get_bin_count_choices,
          ),
      )
  
      def get_number_of_bins(module=self, group=group):
          if len(module.bin_counts) == 1:
              return module.bin_counts[0].bin_count.value
  
          return int(group.bin_count.value)
  
      group.get_number_of_bins = get_number_of_bins
  
      group.append(
          "measurement",
          Choice(
              "Measurement",
              MEASUREMENT_CHOICES,
              doc="The measurement to display.",
          ),
      )
  
      group.append(
          "colormap",
          Colormap(
              "Color map",
              value="Blues",
              doc="""\
  The color map setting chooses the color palette that will be
  used to render the different values for your measurement. If you
  choose "gray", the image will label each of the bins with the
  actual image measurement.""",
          ),
      )
  
      group.append(
          "wants_to_save_display",
          Binary(
              "Save display as image?",
              False,
              doc="""\
  This setting allows you to save the heatmap display as an image that can
  be output using the **SaveImages** module. Choose *{YES}* to save the
  display or *{NO}* if the display is not needed.
  """.format(
                  **{"YES": "Yes", "NO": "No"}
              ),
          ),
      )
  
      group.append(
          "display_name",
          ImageName(
              "Output image name",
              "Heatmap",
              doc="""\
  *(Only used if “Save display as image?” is “{YES}”)*
  
  This setting names the heatmap image so that the name you enter here can
  be selected in a later **SaveImages** or other module.
  """.format(
                  **{"YES": "Yes"}
              ),
          ),
      )
  
      group.append(
          "remover",
          RemoveSettingButton(
              "", "Remove this heatmap display", self.heatmaps, group
          ),
      )
  
      self.heatmaps.append(group)
  
imports: import centrosome.cpmorphology
  import centrosome.propagate
  import centrosome.zernike
  import matplotlib.cm
  import numpy
  import numpy.ma
  import scipy.ndimage
  import scipy.sparse
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.preferences import get_default_colormap
  from cellprofiler_core.setting import HiddenCount, Divider, SettingsGroup, Binary, ValidationError
  from cellprofiler_core.setting.choice import Choice, Colormap
  from cellprofiler_core.setting.do_something import DoSomething, RemoveSettingButton
  from cellprofiler_core.setting.subscriber import LabelSubscriber, ImageListSubscriber, ImageSubscriber
  from cellprofiler_core.setting.text import Integer, ImageName
  from cellprofiler_core.utilities.core.object import crop_labels_and_image, size_similarly
  import cellprofiler.gui.help.content
label_desc: Use image node_id 5 for calling the MeasureObjectIntensityDistribution obj's underlying member method code with example usage: obj.add_heatmap() and returns: int, module