parameters: (subject, xfmname, surface="fiducial", max_dist=np.inf)
return_statement: return dist.T, argdist.T
docstring: Get the distance (in mm) from each functional voxel to the closest
      point on the surface.
  
      Parameters
      ----------
      subject : str
          Name of the subject
      xfmname : str
          Name of the transform
      shape : tuple
          Output shape for the mask
      max_dist : nonnegative float, optional
          Limit computation to only voxels within `max_dist` mm of the surface.
          Makes computation orders of magnitude faster for high-resolution
          volumes.
  
      Returns
      -------
      dist : ndarray
          Distance (in mm) to the closest point on the surface
  
      argdist : ndarray
          Point index for the closest point
docstring_summary: Get the distance (in mm) from each functional voxel to the closest
      point on the surface.
docstring_tokens: Get the distance ( in mm ) from each functional voxel to the closest point on the surface .
function: def get_vox_dist(subject, xfmname, surface="fiducial", max_dist=np.inf):
      """Get the distance (in mm) from each functional voxel to the closest
      point on the surface.
  
      Parameters
      ----------
      subject : str
          Name of the subject
      xfmname : str
          Name of the transform
      shape : tuple
          Output shape for the mask
      max_dist : nonnegative float, optional
          Limit computation to only voxels within `max_dist` mm of the surface.
          Makes computation orders of magnitude faster for high-resolution
          volumes.
  
      Returns
      -------
      dist : ndarray
          Distance (in mm) to the closest point on the surface
  
      argdist : ndarray
          Point index for the closest point
      """
      from scipy.spatial import cKDTree
  
      fiducial, polys = db.get_surf(subject, surface, merge=True)
      xfm = db.get_xfm(subject, xfmname)
      z, y, x = xfm.shape
      idx = np.mgrid[:x, :y, :z].reshape(3, -1).T
      mm = xfm.inv(idx)
  
      tree = cKDTree(fiducial)
      dist, argdist = tree.query(mm, distance_upper_bound=max_dist)
      dist.shape = (x,y,z)
      argdist.shape = (x,y,z)
      return dist.T, argdist.T
function_tokens: def get_vox_dist ( subject , xfmname , surface = "fiducial" , max_dist = np . inf ) : from scipy . spatial import cKDTree fiducial , polys = db . get_surf ( subject , surface , merge = True ) xfm = db . get_xfm ( subject , xfmname ) z , y , x = xfm . shape idx = np . mgrid [ : x , : y , : z ] . reshape ( 3 , - 1 ) . T mm = xfm . inv ( idx ) tree = cKDTree ( fiducial ) dist , argdist = tree . query ( mm , distance_upper_bound = max_dist ) dist . shape = ( x , y , z ) argdist . shape = ( x , y , z ) return dist . T , argdist . T