code: def mask_distance(image, voxelspacing=None, mask=slice(None)):
      r"""
      Computes the distance of each point under the mask to the mask border taking the
      voxel-spacing into account.
  
      Note that this feature is independent of the actual image content, but depends
      solely the mask image. Therefore always a one-dimensional feature is returned,
      even if a multi-spectral image has been supplied.
  
      If no mask has been supplied, the distances to the image borders are returned.
  
      Parameters
      ----------
      image : array_like or list/tuple of array_like
          A single image or a list/tuple of images (for multi-spectral case).
      voxelspacing : sequence of floats
          The side-length of each voxel.
      mask : array_like
          A binary mask for the image.
  
      Returns
      -------
      mask_distance : ndarray
          Each voxels distance to the mask borders.
  
      """
      if type(image) == tuple or type(image) == list:
          image = image[0]
  
      return _extract_mask_distance(
          image, mask=mask, voxelspacing=voxelspacing
      )
  
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 6 for calling a global function with example usage: mask_distance(image, voxelspacing, mask) and returns: _extract_mask_distance