I'm still not sure how to get the adjacency matrix, based on the example.
It seems like lh_faces and rh_faces contain the faces from the original
cortical parcellation, before some sources are removed? I have an ico 3
source space. My leadfield matrix has 1162 sources in total. Thus
fwd['src'][0]['vertno'].shape = 581 and fwd['src'][1]['vertno'].shape =
581. However, fwd['src'][0]['usetris'].shape = 1280 and
fwd['src'][1]['usetris'].shape = 1280, so I'm not sure which faces
correspond to which vertices?
However, since the largest element of 'tris' is np.max(tris), why are
there nonzero entries for the (np.max(tris) + 1)th row/col in the
'edges' matrix?
Should I be using edges[0:npoints-1,0:npoints-1] as my adjacency matrix?
To clarify, after calling stats.rankdata, I still have np.max(tris) = 641,
so mesh_edges adds one more point and the shape of edges is still 642 by
642. Does the extra row/column contain adjacency information for vertex
number 642? I'm still confused by this, since 642 is not an entry in tris.