code: def add_measurements(self, workspace, object_name=None):
      if object_name is None:
          object_name = self.y_name.value
  
      objects = workspace.object_set.get_objects(object_name)
  
      centers = objects.center_of_mass()
  
      if len(centers) == 0:
          center_z, center_y, center_x = [], [], []
      else:
          if objects.volumetric:
              center_z, center_y, center_x = centers.transpose()
          else:
              center_z = [0] * len(centers)
  
              center_y, center_x = centers.transpose()
  
      workspace.measurements.add_measurement(
          object_name,
          M_LOCATION_CENTER_X,
          center_x,
      )
  
      workspace.measurements.add_measurement(
          object_name,
          M_LOCATION_CENTER_Y,
          center_y,
      )
  
      workspace.measurements.add_measurement(
          object_name,
          M_LOCATION_CENTER_Z,
          center_z,
      )
  
      workspace.measurements.add_measurement(
          object_name,
          M_NUMBER_OBJECT_NUMBER,
          numpy.arange(1, objects.count + 1),
      )
  
      workspace.measurements.add_measurement(
          IMAGE,
          FF_COUNT % object_name,
          numpy.array([objects.count], dtype=float),
      )
  
imports: import numpy
  from cellprofiler_core.object import Objects
  from .._module import Module
  from ...constants.measurement import COLTYPE_FLOAT
  from ...constants.measurement import COLTYPE_INTEGER
  from ...constants.measurement import C_COUNT
  from ...constants.measurement import C_LOCATION
  from ...constants.measurement import C_NUMBER
  from ...constants.measurement import FF_COUNT
  from ...constants.measurement import FTR_CENTER_X
  from ...constants.measurement import FTR_CENTER_Y
  from ...constants.measurement import FTR_CENTER_Z
  from ...constants.measurement import FTR_OBJECT_NUMBER
  from ...constants.measurement import IMAGE
  from ...constants.measurement import M_LOCATION_CENTER_X
  from ...constants.measurement import M_LOCATION_CENTER_Y
  from ...constants.measurement import M_LOCATION_CENTER_Z
  from ...constants.measurement import M_NUMBER_OBJECT_NUMBER
  from ...setting.subscriber import ImageSubscriber
  from ...setting.text import LabelName
label_desc: Use image node_id 1 for calling the ImageSegmentation obj's underlying member method code with example usage: obj.add_measurements(workspace, object_name) without return types