docs: 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.] * image.ndim
          
      # get image center and an array holding the images indices
      centers = [(x - 1) / 2. for x in image.shape]
      indices = numpy.indices(image.shape, dtype=numpy.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()