mne.
spatial_tris_connectivity
Compute connectivity from triangles
tris : array
N x 3 array defining triangles.
remap_vertices : bool
Reassign vertex indices based on unique values. Useful to process a subset of triangles. Defaults to False.
verbose : bool, str, int, or None
If not None, override default verbose level (see mne.verbose).
connectivity : sparse COO matrix
The connectivity matrix describing the spatial graph structure.