brainspace.mesh.mesh_elements.get_immediate_adjacency

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

Get immediate adjacency matrix.

Parameters:
  • surf (vtkDataSet or BSDataSet) – Input surface.
  • include_self (bool, optional) – If True, set diagonal elements to 1. 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)) – Immediate adjacency matrix.

Notes

Immediate adjacency: set to one all entries of points that share and edge with current point.