[Mne_analysis] Correspondence of sources with parcellation

thierry nieus thierry.nieus at unimi.it
Fri Aug 30 06:17:02 EDT 2019
Search archives:

        External Email - Use Caution        

Hi Mina,
thank you very much for the code.
I was getting closer to the solution but your help was quite appreciated!
Best
Thierry

On Fri, Aug 30, 2019 at 11:27 AM Mina Jamshidi <jamshidi at cbs.mpg.de> wrote:

>         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
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis



-- 
Department of Biomedical and Clinical Sciences "Luigi Sacco"
University of Milan
Phone: +39 02 503 19731
via G. B. Grassi 74 - 20157 Milano
<https://maps.google.com/?q=via+G.+B.+Grassi+74+-+20157+Milano&entry=gmail&source=g>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190830/cfc0b569/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.jpg
Type: image/jpeg
Size: 15760 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190830/cfc0b569/attachment-0001.jpg 


More information about the Mne_analysis mailing list