def spatial_inter_hemi_connectivity(src, dist, verbose=None):
 from scipy.spatial.distance import cdist
 src = _ensure_src(src, kind='surf')
 conn = cdist(src[0]['rr'][src[0]['vertno']], src[1]['rr'][src[1]['vertno']])
 conn = sparse.csr_matrix((conn <= dist), dtype=int)
 empties = [sparse.csr_matrix((nv, nv), dtype=int) for nv in conn.shape]
 conn = sparse.vstack([sparse.hstack([empties[0], conn]), sparse.hstack([conn.T, empties[1]])])
 return conn

def spatial_inter_hemi_connectivity ( src , dist , verbose = None ) : from scipy . spatial . distance import cdist src = _ensure_src ( src , kind = 'surf' ) conn = cdist ( src [ 0 ] [ 'rr' ] [ src [ 0 ] [ 'vertno' ] ] , src [ 1 ] [ 'rr' ] [ src [ 1 ] [ 'vertno' ] ] ) conn = sparse . csr_matrix ( ( conn <= dist ) , dtype = int ) empties = [ sparse . csr_matrix ( ( nv , nv ) , dtype = int ) for nv in conn . shape ] conn = sparse . vstack ( [ sparse . hstack ( [ empties [ 0 ] , conn ] ) , sparse . hstack ( [ conn . T , empties [ 1 ] ] ) ] ) return conn
get vertices on each hemisphere that are close to the other hemisphere .