code: def _extract_centerdistance(
      image, mask=slice(None), voxelspacing=None
  ):
      """
      Internal, single-image version of `centerdistance`.
      """
      image = numpy.array(image, copy=False)
  
      if None == voxelspacing:
          voxelspacing = [1.0] * image.ndim
  
      # get image center and an array holding the images indices
      centers = [(x - 1) / 2.0 for x in image.shape]
      indices = numpy.indices(image.shape, dtype=float)
  
      # shift to center of image and correct spacing to real world coordinates
      for dim_indices, c, vs in zip(indices, centers, voxelspacing):
          dim_indices -= c
          dim_indices *= vs
  
      # compute euclidean distance to image center
      return numpy.sqrt(numpy.sum(numpy.square(indices), 0))[
          mask
      ].ravel()
  
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 19 for calling a global function with example usage: _extract_centerdistance(image, mask, voxelspacing) and returns: numpy