spectralbrain.build_geometric_connectome#
- spectralbrain.build_geometric_connectome(parcel_descriptors, *, method='wasserstein', **kwargs)[source]#
Build a ROI × ROI geometric connectome from parcel descriptors.
For each pair of parcels, computes the distance between their descriptor distributions.
- Parameters:
parcel_descriptors (dict of {label: ndarray}) – Mapping from parcel label to descriptor array. Each value is shape (N_parcel, T) or (N_parcel,).
method (str) – Distance method (see
descriptor_distance()).**kwargs – Extra args for the distance function.
- Returns:
matrix (ndarray, shape (R, R)) – Symmetric distance matrix.
labels (list) – Ordered parcel labels corresponding to matrix rows/columns.
- Return type:
Examples
>>> parcels = sb.io.apply_parcellation(verts, faces, labels) >>> descs = {} >>> for lab, (v, f) in parcels.items(): ... mesh = BrainMesh(v, f) ... decomp = mesh.decompose(k=30) ... descs[lab] = compute_hks(decomp, n_times=20) >>> C, labs = build_geometric_connectome(descs, method="wasserstein")