[Mne_analysis] Correspondence of sources with parcellation

Mina Jamshidi jamshidi at cbs.mpg.de
Fri Aug 30 05:27:13 EDT 2019
Search archives:

        External Email - Use Caution        

Hi Thierry,

I use this function:

def label2idx(src, label):
    """
    finding the vertex numbers corresponding to vertices in parcel specified in label
    :param src: source spaces
    :param label: label object of the desired parcel
    :return: parc_idx: indexes of the vertices in label,
             parc_hemi_idx: indexes of the vertices in label, but in the corresponding hemisphere
    """
    offset = src[0]['vertno'].shape[0]
    this_hemi = 0 if (label.hemi == 'lh') else 1
    idx = np.intersect1d(label.vertices, src[this_hemi]['vertno'])
    parc_hemi_idx = np.searchsorted(src[this_hemi]['vertno'], idx)
    parc_idx = parc_hemi_idx + offset * this_hemi
    return parc_idx, parc_hemi_idx

Best,
Mina

----- Original Message -----
From: "thierry nieus" <thierry.nieus at unimi.it>
To: "Discussion and support forum for the users of MNE Software" <mne_analysis at nmr.mgh.harvard.edu>
Sent: Thursday, August 29, 2019 6:06:45 PM
Subject: [Mne_analysis] Correspondence of sources with parcellation

External Email - Use Caution 


Dear MNE community, 
I would like to determine the correspondence between the sources of a forward model (say fsaverage, ico 4 5124 sources) and the labels of a parcellation (say aparc). I found some nice examples on MNE website in which the activity of the sources are averaged over a given label ( Generate a functional label from source estimates ) but I am actually looking for something simpler (for a given parcellation find the corresponding indexes of the sources). 
I believe it should be feasible. 
Any ideas? 
Thanks in advance 
Thierry 


-- 
Department of Biomedical and Clinical Sciences "Luigi Sacco" 
University of Milan 
Phone: +39 02 503 19731 
via G. B. Grassi 74 - 20157 Milano 




Il tuo 5 x mille progetti 
Sostieni la ricerca, investi sul futuro dei giovani 

Universita` degli Studi di Milano - codice fiscale 80012650158 

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis


More information about the Mne_analysis mailing list