code: def __obj_surface_distances(
      result, reference, voxelspacing=None, connectivity=1
  ):
      """
      The distances between the surface voxel between all corresponding binary
      objects in result and reference. Correspondence is defined as unique and at least one voxel overlap.
      """
      sds = list()
      (
          labelmap1,
          labelmap2,
          _a,
          _b,
          mapping,
      ) = __distinct_binary_object_correspondences(
          result, reference, connectivity
      )
      slicers1 = find_objects(labelmap1)
      slicers2 = find_objects(labelmap2)
      for lid2, lid1 in list(mapping.items()):
          window = __combine_windows(
              slicers1[lid1 - 1], slicers2[lid2 - 1]
          )
          object1 = labelmap1[window] == lid1
          object2 = labelmap2[window] == lid2
          sds.extend(
              __surface_distances(
                  object1, object2, voxelspacing, connectivity
              )
          )
      return sds
  
imports: import numpy
  from scipy.ndimage import _ni_support
  from scipy.ndimage import distance_transform_edt, binary_erosion, generate_binary_structure
  from scipy.ndimage import label, find_objects
  from scipy.stats import pearsonr
label_desc: Use image node_id 23 for calling a global function with example usage: __obj_surface_distances(result, reference, voxelspacing, connectivity) and returns: sds