code: def measure_images(self, image_set, workspace):
      image = workspace.image_set.get_image(
          image_set, must_be_binary=True
      )
  
      area_occupied = numpy.sum(image.pixel_data > 0)
  
      if area_occupied > 0:
          if image.volumetric:
              perimeter = surface_area(
                  image.pixel_data > 0, spacing=image.spacing
              )
          else:
              perimeter = skimage.measure.perimeter(
                  image.pixel_data > 0
              )
      else:
          perimeter = 0
  
      total_area = numpy.prod(numpy.shape(image.pixel_data))
  
      measurements = workspace.measurements
      pipeline = workspace.pipeline
  
      self._add_image_measurement(
          image_set,
          F_VOLUME_OCCUPIED
          if pipeline.volumetric()
          else F_AREA_OCCUPIED,
          area_occupied,
          measurements,
      )
  
      self._add_image_measurement(
          image_set,
          F_SURFACE_AREA if pipeline.volumetric() else F_PERIMETER,
          perimeter,
          measurements,
      )
  
      self._add_image_measurement(
          image_set,
          F_TOTAL_VOLUME if pipeline.volumetric() else F_TOTAL_AREA,
          total_area,
          measurements,
      )
  
      return [
          [
              image_set,
              str(area_occupied),
              str(perimeter),
              str(total_area),
          ]
      ]
  
imports: import numpy
  import skimage.measure
  from cellprofiler_core.constants.measurement import COLTYPE_FLOAT
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Divider, ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.subscriber import ImageListSubscriber, LabelListSubscriber
label_desc: Use image node_id 9 for calling the MeasureImageAreaOccupied obj's underlying member method code with example usage: obj.measure_images(image_set, workspace) and returns: list