code: def mask_distance(image, voxelspacing = None, mask = slice(None)):
      r
      if type(image) == tuple or type(image) == list:
          image = image[0]
          
      return _extract_mask_distance(image, mask = mask, voxelspacing = voxelspacing)
docs: 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.