code: def _extract_mask_distance(
      image, mask=slice(None), voxelspacing=None
  ):
      """
      Internal, single-image version of `mask_distance`.
      """
      if isinstance(mask, slice):
          mask = numpy.ones(image.shape, numpy.bool_)
  
      distance_map = distance_transform_edt(mask, sampling=voxelspacing)
  
      return _extract_intensities(distance_map, mask)
  
imports: import numpy
  from scipy.ndimage import gaussian_filter, median_filter
  from scipy.ndimage import gaussian_gradient_magnitude
  from scipy.interpolate.interpolate import interp1d
  from scipy.ndimage import distance_transform_edt
  from scipy.ndimage._ni_support import _get_output
  from .utilities import join
  from ..core import ArgumentError
  from ..filter import sum_filter
label_desc: Use image node_id 17 for calling a global function with example usage: _extract_mask_distance(image, mask, voxelspacing) and returns: _extract_intensities