code: def surface_area(label_image, spacing=None, index=None):
      if spacing is None:
          spacing = (1.0,) * label_image.ndim
  
      if index is None:
          (
              verts,
              faces,
              _normals,
              _values,
          ) = skimage.measure.marching_cubes(
              label_image, spacing=spacing, level=0, method="lorensen"
          )
  
          return skimage.measure.mesh_surface_area(verts, faces)
  
      return numpy.sum(
          [
              numpy.round(
                  _label_surface_area(label_image, label, spacing)
              )
              for label in index
          ]
      )
  
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 1 for calling a global function with example usage: surface_area(label_image, spacing, index) and returns: numpy, skimage