code: def create_settings(self):
      self.image_name = ImageSubscriber(
          "Select the input image",
          "None",
          doc="""Select the image whose edges you want to enhance.""",
      )
  
      self.output_image_name = ImageName(
          "Name the output image",
          "EdgedImage",
          doc="""Enter a name for the resulting image with edges enhanced.""",
      )
  
      self.method = Choice(
          "Select an edge-finding method",
          [M_SOBEL, M_PREWITT, M_ROBERTS, M_LOG, M_CANNY, M_KIRSCH],
          doc="""\
  There are several methods that can be used to enhance edges. Often, it
  is best to test them against each other empirically:
  
  -  *%(M_SOBEL)s:* Finds edges using the %(M_SOBEL)s approximation to
     the derivative. The %(M_SOBEL)s method derives a horizontal and
     vertical gradient measure and returns the square-root of the sum of
     the two squared signals.
  -  *%(M_PREWITT)s:* Finds edges using the %(M_PREWITT)s approximation
     to the derivative. It returns edges at those points where the
     gradient of the image is maximum.
  -  *%(M_ROBERTS)s:* Finds edges using the Roberts approximation to the
     derivative. The %(M_ROBERTS)s method looks for gradients in the
     diagonal and anti-diagonal directions and returns the square-root of
     the sum of the two squared signals. This method is fast, but it
     creates diagonal artifacts that may need to be removed by smoothing.
  -  *%(M_LOG)s:* Applies a Laplacian of Gaussian filter to the image and
     finds zero crossings.
  -  *%(M_CANNY)s:* Finds edges by looking for local maxima of the
     gradient of the image. The gradient is calculated using the
     derivative of a Gaussian filter. The method uses two thresholds to
     detect strong and weak edges, and includes the weak edges in the
     output only if they are connected to strong edges. This method is
     therefore less likely than the others to be fooled by noise, and more
     likely to detect true weak edges.
  -  *%(M_KIRSCH)s:* Finds edges by calculating the gradient among the 8
     compass points (North, North-east, etc.) and selecting the maximum as
     the pixel’s value.
  """
          % globals(),
      )
  
      self.wants_automatic_threshold = Binary(
          "Automatically calculate the threshold?",
          True,
          doc="""\
  *(Used only with the "%(M_CANNY)s" option and automatic thresholding)*
  
  Select *Yes* to automatically calculate the threshold using a
  three-category Otsu algorithm performed on the Sobel transform of the
  image.
  
  Select *No* to manually enter the threshold value.
  """
          % globals(),
      )
  
      self.manual_threshold = Float(
          "Absolute threshold",
          0.2,
          0,
          1,
          doc="""\
  *(Used only with the "%(M_CANNY)s" option and manual thresholding)*
  
  The upper cutoff for Canny edges. All Sobel-transformed pixels with this
  value or higher will be marked as an edge. You can enter a threshold
  between 0 and 1.
  """
          % globals(),
      )
  
      self.threshold_adjustment_factor = Float(
          "Threshold adjustment factor",
          1,
          doc="""\
  *(Used only with the "%(M_CANNY)s" option and automatic thresholding)*
  
  This threshold adjustment factor is a multiplier that is applied to both
  the lower and upper Canny thresholds if they are calculated
  automatically. An adjustment factor of 1 indicates no adjustment. The
  adjustment factor has no effect on any threshold entered manually.
  """
          % globals(),
      )
  
      self.direction = Choice(
          "Select edge direction to enhance",
          [E_ALL, E_HORIZONTAL, E_VERTICAL],
          doc="""\
  *(Used only with "%(M_PREWITT)s" and "%(M_SOBEL)s" methods)*
  
  Select the direction of the edges you aim to identify in the image
  (predominantly horizontal, predominantly vertical, or both).
  """
          % globals(),
      )
  
      self.wants_automatic_sigma = Binary(
          "Calculate Gaussian's sigma automatically?",
          True,
          doc="""\
  Select *Yes* to automatically calculate the Gaussian's sigma.
  
  Select *No* to manually enter the value.
  """
          % globals(),
      )
  
      self.sigma = Float(
          "Gaussian's sigma value",
          10,
          doc="""Set a value for Gaussian's sigma.""",
      )
  
      self.wants_automatic_low_threshold = Binary(
          "Calculate value for low threshold automatically?",
          True,
          doc="""\
  *(Used only with the "%(M_CANNY)s" option and automatic thresholding)*
  
  Select *Yes* to automatically calculate the low / soft threshold
  cutoff for the %(M_CANNY)s method.
  
  Select *No* to manually enter the low threshold value.
  """
          % globals(),
      )
  
      self.low_threshold = Float(
          "Low threshold value",
          0.1,
          0,
          1,
          doc="""\
  *(Used only with the "%(M_CANNY)s" option and manual thresholding)*
  
  Enter the soft threshold cutoff for the %(M_CANNY)s method. The
  %(M_CANNY)s method will mark all %(M_SOBEL)s-transformed pixels with
  values below this threshold as not being edges.
  """
          % globals(),
      )
  
imports: import centrosome.filter
  import centrosome.kirsch
  import centrosome.otsu
  import numpy
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.text import Float
  from cellprofiler_core.setting.text import ImageName
  from cellprofiler_library.modules import enhanceedges
label_desc: Use image node_id 1 for calling the EnhanceEdges obj's underlying member method code with example usage: obj.create_settings() without return types