code: def test_add_measurements(self):
      measurements = cellprofiler_core.measurement.Measurements()
  
      module = (
          cellprofiler_core.module.image_segmentation._object_processing.ObjectProcessing()
      )
  
      module.x_name.value = "Objects"
  
      object_set = cellprofiler_core.object.ObjectSet()
  
      labels = numpy.zeros((30, 30), dtype=numpy.uint8)
  
      i, j = numpy.mgrid[-15:15, -7:23]
      labels[i**2 + j**2 <= 25] = 1
  
      i, j = numpy.mgrid[-15:15, -22:8]
      labels[i**2 + j**2 <= 16] = 2
  
      objects = cellprofiler_core.object.Objects()
  
      objects.segmented = labels
  
      object_set.add_objects(objects, "ObjectProcessing")
  
      parent_labels = numpy.zeros((30, 30), dtype=numpy.uint8)
  
      i, j = numpy.mgrid[-15:15, -15:15]
      parent_labels[i**2 + j**2 <= 196] = 1
  
      parent_objects = cellprofiler_core.object.Objects()
  
      parent_objects.segmented = parent_labels
  
      object_set.add_objects(parent_objects, "Objects")
  
      workspace = cellprofiler_core.workspace.Workspace(
          pipeline=None,
          module=module,
          image_set=None,
          object_set=object_set,
          measurements=measurements,
          image_set_list=None,
      )
  
      module.add_measurements(workspace)
  
      expected_center_x = [7.0, 22.0]
  
      actual_center_x = measurements.get_measurement(
          "ObjectProcessing",
          cellprofiler_core.constants.measurement.M_LOCATION_CENTER_X,
      )
  
      numpy.testing.assert_array_equal(
          actual_center_x, expected_center_x
      )
  
      expected_center_y = [15.0, 15.0]
  
      actual_center_y = measurements.get_measurement(
          "ObjectProcessing",
          cellprofiler_core.constants.measurement.M_LOCATION_CENTER_Y,
      )
  
      numpy.testing.assert_array_equal(
          actual_center_y, expected_center_y
      )
  
      expected_center_z = [0.0, 0.0]
  
      actual_center_z = measurements.get_measurement(
          "ObjectProcessing",
          cellprofiler_core.constants.measurement.M_LOCATION_CENTER_Z,
      )
  
      numpy.testing.assert_array_equal(
          actual_center_z, expected_center_z
      )
  
      expected_object_number = [1.0, 2.0]
  
      actual_object_number = measurements.get_measurement(
          "ObjectProcessing",
          cellprofiler_core.constants.measurement.M_NUMBER_OBJECT_NUMBER,
      )
  
      numpy.testing.assert_array_equal(
          actual_object_number, expected_object_number
      )
  
      expected_count = [2.0]
  
      actual_count = measurements.get_measurement(
          cellprofiler_core.constants.measurement.IMAGE,
          cellprofiler_core.constants.measurement.FF_COUNT
          % "ObjectProcessing",
      )
  
      numpy.testing.assert_array_equal(actual_count, expected_count)
  
      expected_children_count = [2]
  
      actual_children_count = measurements.get_measurement(
          "Objects",
          cellprofiler_core.constants.measurement.FF_CHILDREN_COUNT
          % "ObjectProcessing",
      )
  
      numpy.testing.assert_array_equal(
          actual_children_count, expected_children_count
      )
  
      expected_parents = [1, 1]
  
      actual_parents = measurements.get_measurement(
          "ObjectProcessing",
          cellprofiler_core.constants.measurement.FF_PARENT % "Objects",
      )
  
      numpy.testing.assert_array_equal(actual_parents, expected_parents)
  
imports: import numpy
  import cellprofiler_core.constants.measurement
  import cellprofiler_core.image
  import cellprofiler_core.measurement
  import cellprofiler_core.module
  import cellprofiler_core.module.image_segmentation._image_segmentation
  import cellprofiler_core.module.image_segmentation._object_processing
  import cellprofiler_core.object
  import cellprofiler_core.workspace
label_desc: Use image node_id 16 for calling the TestObjectProcessing obj's underlying member method code with example usage: obj.test_add_measurements() without return types