brainspace.utils.parcellation.relabel_by_overlap¶
-
brainspace.utils.parcellation.
relabel_by_overlap
(lab, ref_lab)[source]¶ Relabel according to overlap with reference.
Parameters: - lab (ndarray, shape = (n_labels,)) – Array of labels.
- ref_lab (ndarray, shape = (n_labels,)) – Reference array of labels.
Returns: new_lab (ndarray, shape = (n_labels,)) – Array relabeled using the reference array.
Notes
Correspondences between labels are based on largest overlap using the Hungarian algorithm.