brainspace.mesh.mesh_elements.get_ring_adjacency

brainspace.mesh.mesh_elements.get_ring_adjacency(surf, n_ring=1, include_self=True, mask=None, dtype=<class 'numpy.uint8'>)[source]

Get adjacency in the neighborhood of each point.

Parameters:
  • surf (vtkDataSet or BSDataSet) – Input surface.
  • n_ring (int, optional) – Size of neighborhood. Default is 1.
  • include_self (bool, optional) – If True, set diagonal elements to 1. Otherwise, the diagonal is set to 0. Default is True.
  • mask (1D ndarray, optional) – Binary mask. If specified, only use points within the mask. Default is None.
  • dtype (dtype, optional) – Data type. Default is uint8.
Returns:

adj (sparse matrix, shape (n_points, n_points)) – Adjacency matrix in n_ring ring.