docstr: Create your settings by subclassing this function
  
  create_settings is called at the end of initialization.
  
  You should create the setting variables for your module here:
      # Ask the user for the input image
      self.image_name = .ImageSubscriber(...)
      # Ask the user for the name of the output image
      self.output_image = .ImageName(...)
      # Ask the user for a parameter
      self.smoothing_size = .Float(...)
docstr_tok: ["Create","your","settings","by","subclassing","this","function","create_settings","is","called","at","the","end","of","initialization",".","You","should","create","the","setting","variables","for","your","module","here",":","#","Ask","the","user","for","the","input","image","self.image_name","=",".ImageSubscriber","(","...",")","#","Ask","the","user","for","the","name","of","the","output","image","self.output_image","=",".ImageName","(","...",")","#","Ask","the","user","for","a","parameter","self.smoothing_size","=",".Float","(","...",")"]
code: def create_settings(self):
      """Create your settings by subclassing this function
  
      create_settings is called at the end of initialization.
  
      You should create the setting variables for your module here:
          # Ask the user for the input image
          self.image_name = .ImageSubscriber(...)
          # Ask the user for the name of the output image
          self.output_image = .ImageName(...)
          # Ask the user for a parameter
          self.smoothing_size = .Float(...)
      """
      self.objects_or_image = Choice(
          "Display object or image measurements?",
          [OI_OBJECTS, OI_IMAGE],
          doc="""\
  -  *%(OI_OBJECTS)s* displays measurements made on objects.
  -  *%(OI_IMAGE)s* displays a single measurement made on an image.
  """
          % globals(),
      )
  
      self.objects_name = LabelSubscriber(
          "Select the input objects",
          "None",
          doc="""\
  *(Used only when displaying object measurements)*
  
  Choose the name of objects identified by some previous module (such as
  **IdentifyPrimaryObjects** or **IdentifySecondaryObjects**).
  """,
      )
  
      def object_fn():
          if self.objects_or_image == OI_OBJECTS:
              return self.objects_name.value
          else:
              return "Image"
  
      self.measurement = Measurement(
          "Measurement to display",
          object_fn,
          doc="""\
  Choose the measurement to display. This will be a measurement made by
  some previous module on either the whole image (if displaying a single
  image measurement) or on the objects you selected.
  """,
      )
  
      self.wants_image = Binary(
          "Display background image?",
          True,
          doc="""\
  Choose whether or not to display the measurements on
  a background image. Usually, you will want to see the image
  context for the measurements, but it may be useful to save
  just the overlay of the text measurements and composite the
  overlay image and the original image later. Choose "Yes" to
  display the measurements on top of a background image or "No"
  to display the measurements on a black background.""",
      )
  
      self.image_name = ImageSubscriber(
          "Select the image on which to display the measurements",
          "None",
          doc="""\
  Choose the image to be displayed behind the measurements.
  This can be any image created or loaded by a previous module.
  If you have chosen not to display the background image, the image
  will only be used to determine the dimensions of the displayed image.""",
      )
  
      self.color_or_text = Choice(
          "Display mode",
          [CT_TEXT, CT_COLOR],
          doc="""\
  *(Used only when displaying object measurements)*
  
  Choose how to display the measurement information. If you choose
  %(CT_TEXT)s, **DisplayDataOnImage** will display the numeric value on
  top of each object. If you choose %(CT_COLOR)s, **DisplayDataOnImage**
  will convert the image to grayscale, if necessary, and display the
  portion of the image within each object using a hue that indicates the
  measurement value relative to the other objects in the set using the
  default color map.
  """
          % globals(),
      )
  
      self.colormap = Colormap(
          "Color map",
          doc="""\
  *(Used only when displaying object measurements)*
  
  This is the color map used as the color gradient for coloring the
  objects by their measurement values. See `this page`_ for pictures
  of the available colormaps.
  
  .. _this page: http://matplotlib.org/users/colormaps.html
              """,
      )
      self.text_color = Color(
          "Text color",
          "red",
          doc="""This is the color that will be used when displaying the text.""",
      )
  
      self.display_image = ImageName(
          "Name the output image that has the measurements displayed",
          "DisplayImage",
          doc="""\
  The name that will be given to the image with the measurements
  superimposed. You can use this name to refer to the image in subsequent
  modules (such as **SaveImages**).
  """,
      )
      self.sci_notation = Binary(
          "Use scientific notation?",
          False,
          doc="""Choose whether to display data in scientific notation.
  """,
      )
  
      self.font_choice = Choice(
          "Font",
          font_list,
          doc="""\
  Set the font of the text to be displayed. 
  
  Note: The fonts will be loaded from the system running CellProfiler. 
  Not all fonts that are loaded will have the required glyphs, leading to 
  blank or incomplete data displays. Moreover, not all fonts will support 
  font weight changes. 
  """,
      )
      self.font_weight = Choice(
          "Font weight",
          [F_WEIGHT_NORMAL, F_WEIGHT_BOLD],
          value="normal",
          doc="""Set the font weight of the text to be displayed""",
      )
  
      self.font_size = Integer(
          "Font size (points)",
          10,
          minval=1,
          doc="""Set the font size of the letters to be displayed.""",
      )
  
      self.decimals = Integer(
          "Number of decimals",
          2,
          minval=0,
          doc="""Set how many decimals to be displayed, for example 2 decimals for 0.01; 3 decimals for 0.001.""",
      )
  
      self.saved_image_contents = Choice(
          "Image elements to save",
          [E_IMAGE, E_FIGURE, E_AXES],
          doc="""\
  This setting controls the level of annotation on the image:
  
  -  *%(E_IMAGE)s:* Saves the image with the overlaid measurement
     annotations.
  -  *%(E_AXES)s:* Adds axes with tick marks and image coordinates.
  -  *%(E_FIGURE)s:* Adds a title and other decorations.
  """
          % globals(),
      )
  
      self.offset = Integer(
          "Annotation offset (in pixels)",
          0,
          doc="""\
  Add a pixel offset to the measurement. Normally, the text is
  placed at the object (or image) center, which can obscure relevant features of
  the object. This setting adds a specified offset to the text, in a random
  direction.""",
      )
  
      self.color_map_scale_choice = Choice(
          "Color map scale",
          [CMS_USE_MEASUREMENT_RANGE, CMS_MANUAL],
          doc="""\
  *(Used only when displaying object measurements as a colormap)*
  
  **DisplayDataOnImage** assigns a color to each object’s measurement
  value from a colormap when in colormap-mode, mapping the value to a
  color along the colormap’s continuum. This mapping has implicit upper
  and lower bounds to its range which are the extremes of the colormap.
  This setting determines whether the extremes are the minimum and
  maximum values of the measurement from among the objects in the
  current image or manually-entered extremes.
  
  -  *%(CMS_USE_MEASUREMENT_RANGE)s:* Use the full range of colors to
     get the maximum contrast within the image.
  -  *%(CMS_MANUAL)s:* Manually set the upper and lower bounds so that
     images with different maxima and minima can be compared by a uniform
     color mapping.
  """
          % globals(),
      )
      self.color_map_scale = FloatRange(
          "Color map range",
          value=(0.0, 1.0),
          doc="""\
  *(Used only when setting a manual colormap range)*
  
  This setting determines the lower and upper bounds of the values for the
  color map.
  """,
      )
  
imports: import matplotlib.axes
  import matplotlib.cm
  import matplotlib.figure
  import matplotlib.text
  import numpy
  from cellprofiler_core.constants.measurement import C_FILE_NAME
  from cellprofiler_core.constants.measurement import C_PATH_NAME
  from cellprofiler_core.constants.measurement import M_LOCATION_CENTER_X
  from cellprofiler_core.constants.measurement import M_LOCATION_CENTER_Y
  from cellprofiler_core.image import FileImage
  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 Binary
  from cellprofiler_core.setting import Color
  from cellprofiler_core.setting import Measurement
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.choice import Colormap
  from cellprofiler_core.setting.range import FloatRange
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import ImageName
  from cellprofiler_core.setting.text import Integer
label_desc: Use image node_id 1 for calling the DisplayDataOnImage obj's underlying member method code with example usage: obj.create_settings() and returns: self, str