docstr: Run the module
  
  workspace    - The workspace contains
      pipeline     - instance of cpp for this run
      image_set    - the images in the image set being processed
      object_set   - the objects (labeled masks) in this image set
      measurements - the measurements for this run
      frame        - the parent frame to whatever frame is created. None means don't draw.
docstr_tok: ["Run","the","module","workspace","-","The","workspace","contains","pipeline","-","instance","of","cpp","for","this","run","image_set","-","the","images","in","the","image","set","being","processed","object_set","-","the","objects","(","labeled","masks",")","in","this","image","set","measurements","-","the","measurements","for","this","run","frame","-","the","parent","frame","to","whatever","frame","is","created",".","None","means","do","n't","draw","."]
code: def run(self, workspace):
      """Run the module
  
      workspace    - The workspace contains
          pipeline     - instance of cpp for this run
          image_set    - the images in the image set being processed
          object_set   - the objects (labeled masks) in this image set
          measurements - the measurements for this run
          frame        - the parent frame to whatever frame is created. None means don't draw.
      """
      orig_objects_name = self.object_name.value
      filtered_objects_name = self.filtered_objects.value
  
      orig_objects = workspace.object_set.get_objects(orig_objects_name)
      assert isinstance(orig_objects, Objects)
      orig_labels = [l for l, c in orig_objects.get_labels()]
  
      if self.wants_image_display:
          guide_image = workspace.image_set.get_image(
              self.image_name.value
          )
          guide_image = guide_image.pixel_data
          if guide_image.dtype == bool:
              guide_image = guide_image.astype(int)
          if numpy.any(guide_image != numpy.min(guide_image)):
              guide_image = (guide_image - numpy.min(guide_image)) / (
                  numpy.max(guide_image) - numpy.min(guide_image)
              )
      else:
          guide_image = None
      filtered_labels = workspace.interaction_request(
          self,
          orig_labels,
          guide_image,
          workspace.measurements.image_set_number,
      )
      if filtered_labels is None:
          # Ask whoever is listening to stop doing stuff
          workspace.cancel_request()
          # Have to soldier on until the cancel takes effect...
          filtered_labels = orig_labels
      #
      # Renumber objects consecutively if asked to do so
      #
      unique_labels = numpy.unique(numpy.array(filtered_labels))
      unique_labels = unique_labels[unique_labels != 0]
      object_count = len(unique_labels)
      if self.renumber_choice == R_RENUMBER:
          mapping = numpy.zeros(
              1
              if len(unique_labels) == 0
              else numpy.max(unique_labels) + 1,
              int,
          )
          mapping[unique_labels] = numpy.arange(1, object_count + 1)
          filtered_labels = [mapping[l] for l in filtered_labels]
      #
      # Make the objects out of the labels
      #
      filtered_objects = Objects()
      i, j = numpy.mgrid[
          0 : filtered_labels[0].shape[0],
          0 : filtered_labels[0].shape[1],
      ]
      ijv = numpy.zeros((0, 3), filtered_labels[0].dtype)
      for l in filtered_labels:
          ijv = numpy.vstack(
              (
                  ijv,
                  numpy.column_stack((i[l != 0], j[l != 0], l[l != 0])),
              )
          )
      filtered_objects.set_ijv(ijv, orig_labels[0].shape)
      if orig_objects.has_unedited_segmented():
          filtered_objects.unedited_segmented = (
              orig_objects.unedited_segmented
          )
      if orig_objects.parent_image is not None:
          filtered_objects.parent_image = orig_objects.parent_image
      workspace.object_set.add_objects(
          filtered_objects, filtered_objects_name
      )
      #
      # Add parent/child & other measurements
      #
      m = workspace.measurements
      child_count, parents = orig_objects.relate_children(
          filtered_objects
      )
      m.add_measurement(
          filtered_objects_name,
          FF_PARENT % orig_objects_name,
          parents,
      )
      m.add_measurement(
          orig_objects_name,
          FF_CHILDREN_COUNT % filtered_objects_name,
          child_count,
      )
      #
      # The object count
      #
      add_object_count_measurements(
          m, filtered_objects_name, object_count
      )
      #
      # The object locations
      #
      add_object_location_measurements_ijv(
          m, filtered_objects_name, ijv
      )
  
      workspace.display_data.orig_ijv = orig_objects.ijv
      workspace.display_data.filtered_ijv = filtered_objects.ijv
      workspace.display_data.shape = orig_labels[0].shape
  
imports: from cellprofiler_core.constants.measurement import COLTYPE_INTEGER
  from cellprofiler_core.constants.measurement import FF_CHILDREN_COUNT
  from cellprofiler_core.constants.measurement import FF_PARENT
  from cellprofiler_core.image import ObjectsImage
  from cellprofiler_core.module import Identify
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.subscriber import LabelSubscriber
  from cellprofiler_core.setting.text import LabelName
  from cellprofiler_core.utilities.core.module.identify import add_object_count_measurements
  from cellprofiler_core.utilities.core.module.identify import add_object_location_measurements_ijv
  from cellprofiler_core.utilities.core.module.identify import get_object_measurement_columns
  from cellprofiler.modules import _help
  import os
  import numpy
  from cellprofiler_core.object import Objects
  from cellprofiler_core.setting import Binary
  from cellprofiler_core.utilities.pathname import pathname2url
label_desc: Use image node_id 4 for calling the EditObjectsManually obj's underlying member method code with example usage: obj.run(workspace) without return types