brainspace.mesh.mesh_elements.get_ring_distance¶
-
brainspace.mesh.mesh_elements.
get_ring_distance
(surf, n_ring=1, metric='geodesic', mask=None, dtype=<class 'float'>)[source]¶ Get distance matrix in the neighborhood of each point.
Parameters: - surf (vtkDataSet or BSDataSet) – Input surface.
- n_ring (int, optional) – Size of neighborhood. Default is 1.
- metric ({'euclidean', 'sqeuclidean', 'geodesic'}, optional) – Distance metric. Default is ‘geodesic’.
- mask (1D ndarray, optional) – Binary mask. If specified, only use points within the mask. Default is None.
- dtype (dtype, optional) – Data type. Default is np.float.
Returns: dist (sparse matrix, shape (n_points, n_points)) – Distance matrix in n_ring ring..
Notes
Distance is only computed for points in the ring of current point. When using geodesic, shortest paths are restricted to points within the ring.