[Mne_analysis] The problem with saving morphed labels to an annot file

Peled, Noam NPELED at mgh.harvard.edu
Mon Apr 2 23:09:33 EDT 2018
Search archives:

Hey Eric,

No, I've just used label.morph() for each label from fsaverage to sample subject.

That is actually my question, if someone has a good approach to avoid these overlaps.

I'm using a naive approach (which also depends on the order of the labels) that uses a vertices->labels mapping:

for label in labels:
    for vertice in label.vertices:
        lookup[hemi][vertice] = labels_names.index(label.name)

And then set the labels vertices:

for vertice, label in lookup[hemi].items():
    labels_vertices[label].append(vertice)


I'm wondering if someone has implemented a better solution.


Thanks!

Noam

________________________________
From: mne_analysis-bounces at nmr.mgh.harvard.edu <mne_analysis-bounces at nmr.mgh.harvard.edu> on behalf of Eric Larson <larson.eric.d at gmail.com>
Sent: Monday, April 2, 2018 6:49:23 PM
To: Discussion and support forum for the users of MNE Software
Subject: Re: [Mne_analysis] The problem with saving morphed labels to an annot file

Hey Noam,

Does this code guarantee that the resulting morphed labels do not overlap?

Eric


On Mon, Apr 2, 2018 at 6:39 PM, Peled, Noam <NPELED at mgh.harvard.edu<mailto:NPELED at mgh.harvard.edu>> wrote:

Hey Alex,

Yes, sure!

You can find the code here:

https://github.com/pelednoam/mmvt/blob/master/src/misc/labels_morphing_problem.py

I'm using the Lausanne125 parcellation (http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0048121), but this problem can also be replicated using the aparc.DKTatlas40 atlas (or almost any other atlas I assume).

If you wish to run it with the Lausanne125 parcellation, the fsaverage annot files can be found here:

https://www.dropbox.com/sh/qvpvzf35konkwe5/AADVCp24TxLa_SBUSAAvCuFMa?dl=0


Thanks!

Noam

________________________________
From: mne_analysis-bounces at nmr.mgh.harvard.edu<mailto:mne_analysis-bounces at nmr.mgh.harvard.edu> <mne_analysis-bounces at nmr.mgh.harvard.edu<mailto:mne_analysis-bounces at nmr.mgh.harvard.edu>> on behalf of Alexandre Gramfort <alexandre.gramfort at inria.fr<mailto:alexandre.gramfort at inria.fr>>
Sent: Wednesday, March 28, 2018 3:32:34 AM
To: Discussion and support forum for the users of MNE Software
Subject: Re: [Mne_analysis] The problem with saving morphed labels to an annot file

hi Noam,

I personally don't have a solution for this. Maybe someone else?

could you provide a code snippet to replicate the pb?

Alex


On Wed, Mar 28, 2018 at 4:24 AM, Peled, Noam <NPELED at mgh.harvard.edu<mailto:NPELED at mgh.harvard.edu>> wrote:
> Dear group,
>
> It seems like an old problem, but I couldn't find a reasonable solution,
>
> When morphing labels from fsaverage to a subject, in most cases the annot
> file cannot be written due to vertices that belong to more than one label.
>
> I've implemented several solutions, but in some cases, none of them gives a
> reasonable result.
>
>
> Thanks,
>
> Noam
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu<mailto:Mne_analysis at nmr.mgh.harvard.edu>
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> The information in this e-mail is intended only for the person to whom it is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu<mailto: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<mailto:Mne_analysis at nmr.mgh.harvard.edu>
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180403/e2f405d9/attachment-0001.html 


More information about the Mne_analysis mailing list