docstr: Create the settings for the module
  
  Create the settings for the module during initialization.
docstr_tok: ["Create","the","settings","for","the","module","Create","the","settings","for","the","module","during","initialization","."]
code: def create_settings(self):
      """Create the settings for the module
  
      Create the settings for the module during initialization.
      """
      self.contrast_choice = Choice(
          "Make classification decision based on",
          [BY_SINGLE_MEASUREMENT, BY_TWO_MEASUREMENTS, BY_MODEL],
          doc="""\
  This setting controls how many measurements are used to make a
  classifications decision for each object:
  
  -  *%(BY_SINGLE_MEASUREMENT)s:* Classifies each object based on a
     single measurement.
  -  *%(BY_TWO_MEASUREMENTS)s:* Classifies each object based on a pair
     of measurements taken together (that is, an object must meet two
     criteria to belong to a class).
  -  *%(BY_MODEL)s:* Classifies each object based on a machine learning
     .model or .rules file produced by CellProfiler Analyst.
  
  """
          % globals(),
      )
  
      ############### Single measurement settings ##################
      #
      # A list holding groupings for each of the single measurements
      # to be done
      #
      self.single_measurements = []
      #
      # A count of # of measurements
      #
      self.single_measurement_count = HiddenCount(
          self.single_measurements
      )
      #
      # Add one single measurement to start off
      #
      self.add_single_measurement(False)
      #
      # A button to press to get another measurement
      #
      self.add_measurement_button = DoSomething(
          "", "Add another classification", self.add_single_measurement
      )
      #
      ############### Two-measurement settings #####################
      #
      # The object for the contrasting method
      #
      self.object_name = LabelSubscriber(
          "Select the object name",
          "None",
          doc="""\
  Choose the object that you want to measure from the list. This should be
  an object created by a previous module such as
  **IdentifyPrimaryObjects**, **IdentifySecondaryObjects**, **IdentifyTertiaryObjects**, or **Watershed**
  """,
      )
  
      #
      # The two measurements for the contrasting method
      #
      def object_fn():
          return self.object_name.value
  
      self.first_measurement = Measurement(
          "Select the first measurement",
          object_fn,
          doc="""\
  *(Used only if using a pair of measurements)*
  
  Choose a measurement made on the above object. This is the first of two
  measurements that will be contrasted together. The measurement should be
  one made on the object in a prior module.
  """,
      )
  
      self.first_threshold_method = Choice(
          "Method to select the cutoff",
          [TM_MEAN, TM_MEDIAN, TM_CUSTOM],
          doc="""\
  *(Used only if using a pair of measurements)*
  
  Objects are classified as being above or below a cutoff value for a
  measurement. You can set this cutoff threshold in one of three ways:
  
  -  *%(TM_MEAN)s*: At the mean of the measurement’s value for all
     objects in the image cycle.
  -  *%(TM_MEDIAN)s*: At the median of the measurement’s value for all
     objects in the image set.
  -  *%(TM_CUSTOM)s*: You specify a custom threshold value.
  """
          % globals(),
      )
  
      self.first_threshold = Float(
          "Enter the cutoff value",
          0.5,
          doc="""\
  *(Used only if using a pair of measurements)*
  
  This is the cutoff value separating objects in the two classes.""",
      )
  
      self.second_measurement = Measurement(
          "Select the second measurement",
          object_fn,
          doc="""\
  *(Used only if using a pair of measurements)*
  
  Select a measurement made on the above object. This is
  the second of two measurements that will be contrasted together.
  The measurement should be one made on the object in a prior
  module.""",
      )
  
      self.second_threshold_method = Choice(
          "Method to select the cutoff",
          [TM_MEAN, TM_MEDIAN, TM_CUSTOM],
          doc="""\
  *(Used only if using a pair of measurements)*
  
  Objects are classified as being above or below a cutoff value for a
  measurement. You can set this cutoff threshold in one of three ways:
  
  -  *%(TM_MEAN)s:* At the mean of the measurement’s value for all
     objects in the image cycle.
  -  *%(TM_MEDIAN)s:* At the median of the measurement’s value for all
     objects in the image set.
  -  *%(TM_CUSTOM)s:* You specify a custom threshold value.
  """
          % globals(),
      )
  
      self.second_threshold = Float(
          "Enter the cutoff value",
          0.5,
          doc="""\
  *(Used only if using a pair of measurements)*
  
  This is the cutoff value separating objects in the two classes.""",
      )
  
      self.wants_custom_names = Binary(
          "Use custom names for the bins?",
          False,
          doc="""\
  *(Used only if using a pair of measurements)*
  
  Select "*Yes*" if you want to specify the names of each bin
  measurement.
  
  Select "*No*" to create names based on the measurements. For instance,
  for “Intensity_MeanIntensity_Green” and
  “Intensity_TotalIntensity_Blue”, the module generates measurements
  such as
  “Classify_Intensity_MeanIntensity_Green_High_Intensity_TotalIntensity_Low”.
  """,
      )
  
      self.low_low_custom_name = Alphanumeric(
          "Enter the low-low bin name",
          "low_low",
          doc="""\
  *(Used only if using a pair of measurements)*
  
  Name of the measurement for objects that fall below the threshold for
  both measurements.
  """,
      )
  
      self.low_high_custom_name = Alphanumeric(
          "Enter the low-high bin name",
          "low_high",
          doc="""\
  *(Used only if using a pair of measurements)*
  
  Name of the measurement for objects whose
  first measurement is below threshold and whose second measurement
  is above threshold.
  """,
      )
  
      self.high_low_custom_name = Alphanumeric(
          "Enter the high-low bin name",
          "high_low",
          doc="""\
  *(Used only if using a pair of measurements)*
  
  Name of the measurement for objects whose
  first measurement is above threshold and whose second measurement
  is below threshold.""",
      )
  
      self.high_high_custom_name = Alphanumeric(
          "Enter the high-high bin name",
          "high_high",
          doc="""\
  *(Used only if using a pair of measurements)*
  
  Name of the measurement for objects that
  are above the threshold for both measurements.""",
      )
  
      self.wants_image = Binary(
          "Retain an image of the classified objects?",
          False,
          doc="""\
  Select "*Yes*" to retain the image of the objects color-coded
  according to their classification, for use later in the pipeline (for
  example, to be saved by a **SaveImages** module).
  """,
      )
  
      self.image_name = ImageName(
          "Enter the image name",
          "None",
          doc="""\
  *(Used only if the classified object image is to be retained for later use in the pipeline)*
  
  Enter the name to be given to the classified object image.""",
      )
  
      self.rules.create_settings()
  
      self.allow_fuzzy = self.rules.settings()[0]
  
imports: import functools
  import os
  import numpy
  from cellprofiler.modules import _help
  from cellprofiler.utilities.rules import Rules
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT, M_LOCATION_CENTER_X, M_LOCATION_CENTER_Y, COLTYPE_VARCHAR, C_COUNT, C_CHILDREN, C_LOCATION, C_NUMBER, C_PARENT, FTR_OBJECT_NUMBER, FTR_CENTER_X, FTR_CENTER_Y, FTR_CENTER_Z
  from cellprofiler_core.constants.measurement import COLTYPE_INTEGER
  from cellprofiler_core.constants.measurement import IMAGE
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.object import Objects
  from cellprofiler_core.preferences import get_default_colormap, get_headless
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting import Divider
  from cellprofiler_core.setting import HiddenCount
  from cellprofiler_core.setting import Measurement
  from cellprofiler_core.setting import SettingsGroup
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.do_something import DoSomething
  from cellprofiler_core.setting.do_something import RemoveSettingButton
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import Alphanumeric, Directory, Filename, LabelName
  from cellprofiler_core.setting.text import Float
  from cellprofiler_core.setting.text import ImageName
  from cellprofiler_core.setting.text import Integer
  from cellprofiler_core.setting.text import Text
  from cellprofiler_core.constants.measurement import FF_CHILDREN_COUNT
  from cellprofiler_core.constants.measurement import FF_COUNT
  from cellprofiler_core.constants.measurement import FF_PARENT
  from cellprofiler_core.module.image_segmentation import ImageSegmentation
label_desc: Use image node_id 2 for calling the ClassifyObjects obj's underlying member method code with example usage: obj.create_settings() and returns: self