code: def run(self, workspace):
      input_objects = workspace.object_set.get_objects(
          self.object_name.value
      )
  
      output_objects = cellprofiler_core.object.Objects()
  
      output_objects.segmented = self.do_labels(
          input_objects.segmented, workspace
      )
  
      # If we're shrinking objects we treat objects from the final segmentation as truth when generating
      # the unedited segmentations. This prevents edited/hole-filled objects from ending up with slightly
      # different centers (which would impact other modules).
      if (
          input_objects.has_small_removed_segmented
          and self.operation
          not in (
              O_EXPAND,
              O_EXPAND_INF,
              O_DIVIDE,
              O_EXPAND_BY_MEASUREMENT,
          )
      ):
          shrunk_objects = self.do_labels(
              input_objects.small_removed_segmented, workspace
          )
          output_objects.small_removed_segmented = numpy.where(
              input_objects.segmented > 0,
              output_objects.segmented,
              shrunk_objects,
          )
  
      if (
          input_objects.has_unedited_segmented
          and self.operation
          not in (
              O_EXPAND,
              O_EXPAND_INF,
              O_DIVIDE,
              O_EXPAND_BY_MEASUREMENT,
          )
      ):
          shrunk_objects = self.do_labels(
              input_objects.unedited_segmented, workspace
          )
          output_objects.unedited_segmented = numpy.where(
              input_objects.segmented > 0,
              output_objects.segmented,
              shrunk_objects,
          )
  
      workspace.object_set.add_objects(
          output_objects, self.output_object_name.value
      )
  
      add_object_count_measurements(
          workspace.measurements,
          self.output_object_name.value,
          numpy.max(output_objects.segmented),
      )
  
      add_object_location_measurements(
          workspace.measurements,
          self.output_object_name.value,
          output_objects.segmented,
      )
  
      if self.show_window:
          workspace.display_data.input_objects_segmented = (
              input_objects.segmented
          )
  
          workspace.display_data.output_objects_segmented = (
              output_objects.segmented
          )
  
imports: 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 LabelSubscriber
  from cellprofiler_core.setting.text import LabelName, Integer
  from cellprofiler_core.setting import Measurement
  from cellprofiler_core.utilities.core.module.identify import add_object_location_measurements, add_object_count_measurements, get_object_measurement_columns
  from cellprofiler_library.modules import expand_or_shrink_objects
  from cellprofiler.modules import _help
  import centrosome.cpmorphology
  import numpy
  import scipy.ndimage
  import cellprofiler_core.object
label_desc: Use image node_id 4 for calling the ExpandOrShrinkObjects obj's underlying member method code with example usage: obj.run(workspace) without return types