<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hey Eric,</p>
<p style="margin-top:0;margin-bottom:0">No, I've just used&nbsp;<span>label.morph() for each label from fsaverage to sample subject.&nbsp;</span></p>
<p style="margin-top:0;margin-bottom:0"><span>That is actually my question, if someone&nbsp;has a good approach to avoid these overlaps.&nbsp;</span></p>
<p style="margin-top:0;margin-bottom:0"><span>I'm using a naive approach (which also depends on the order of the labels) that uses a vertices-&gt;labels mapping:</span></p>
<p style="margin-top:0;margin-bottom:0"><span></p>
<pre style="font-family: &quot;DejaVu Sans Mono&quot;; font-size: 11.3pt;"><span style="color:#000080;font-weight:bold;">for </span>label <span style="color:#000080;font-weight:bold;">in </span>labels:<br>    <span style="color:#000080;font-weight:bold;">for </span>vertice <span style="color:#000080;font-weight:bold;">in </span>label.vertices:<br>        lookup[hemi][vertice] = labels_names.index(label.name)</pre>
</span>
<p></p>
<p style="margin-top:0;margin-bottom:0"><span>And then set the labels vertices:</span></p>
<p style="margin-top:0;margin-bottom:0"><span></p>
<pre style="font-family: &quot;DejaVu Sans Mono&quot;; font-size: 11.3pt;"><span style="color:#000080;font-weight:bold;">for </span>vertice, label <span style="color:#000080;font-weight:bold;">in </span>lookup[hemi].items():<br>    labels_vertices[label].append(vertice)</pre>
</span>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I'm wondering if someone has implemented a better solution.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks!</p>
<p style="margin-top:0;margin-bottom:0">Noam</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> mne_analysis-bounces@nmr.mgh.harvard.edu &lt;mne_analysis-bounces@nmr.mgh.harvard.edu&gt; on behalf of Eric Larson &lt;larson.eric.d@gmail.com&gt;<br>
<b>Sent:</b> Monday, April 2, 2018 6:49:23 PM<br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Subject:</b> Re: [Mne_analysis] The problem with saving morphed labels to an annot file</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">
<div>Hey Noam,</div>
<div><br>
</div>
Does this code guarantee that the resulting morphed labels do not overlap?
<div><br>
</div>
<div>Eric</div>
<div><br>
<div class="x_gmail_extra"><br>
<div class="x_gmail_quote">On Mon, Apr 2, 2018 at 6:39 PM, Peled, Noam <span dir="ltr">
&lt;<a href="mailto:NPELED@mgh.harvard.edu" target="_blank">NPELED@mgh.harvard.edu</a>&gt;</span> wrote:<br>
<blockquote class="x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
<div dir="ltr">
<div id="x_m_-1325830981210329137divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0; margin-bottom:0">Hey Alex,</p>
<p style="margin-top:0; margin-bottom:0">Yes, sure!</p>
<p style="margin-top:0; margin-bottom:0">You can find the code here:</p>
<p style="margin-top:0; margin-bottom:0"><a href="https://github.com/pelednoam/mmvt/blob/master/src/misc/labels_morphing_problem.py" class="x_m_-1325830981210329137OWAAutoLink" id="x_m_-1325830981210329137LPlnk21822" target="_blank">https://github.com/pelednoam/<wbr>mmvt/blob/master/src/misc/<wbr>labels_morphing_problem.py</a></p>
<p style="margin-top:0; margin-bottom:0">I'm using the&nbsp;<span>Lausanne125 parcellation&nbsp;<span>(<a href="http://journals.plos.org/plosone/article?id=10.1371/journal.pone.0048121" class="x_m_-1325830981210329137OWAAutoLink" id="x_m_-1325830981210329137LPlnk412500" target="_blank">http://journals.<wbr>plos.org/plosone/article?id=<wbr>10.1371/journal.pone.0048121</a>),
 but this problem can also be replicated using the&nbsp;<span>aparc.DKTatlas40 atlas (or almost any other atlas I assume).</span></span></span></p>
<p style="margin-top:0; margin-bottom:0"><span>If you wish to run it with the&nbsp;<span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,NotoColorEmoji,&quot;Segoe UI Symbol&quot;,&quot;Android Emoji&quot;,EmojiSymbols; font-size:16px">Lausanne125
 parcellation, the fsaverage annot files can be found here:</span></span></p>
<p style="margin-top:0; margin-bottom:0"><span><a href="https://www.dropbox.com/sh/qvpvzf35konkwe5/AADVCp24TxLa_SBUSAAvCuFMa?dl=0" class="x_m_-1325830981210329137OWAAutoLink" id="x_m_-1325830981210329137LPlnk973285" target="_blank">https://www.dropbox.com/sh/<wbr>qvpvzf35konkwe5/AADVCp24TxLa_<wbr>SBUSAAvCuFMa?dl=0</a></span></p>
<p style="margin-top:0; margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Thanks!</span></p>
<p style="margin-top:0; margin-bottom:0"><span>Noam</span><br>
</p>
</div>
<hr style="display:inline-block; width:98%">
<div id="x_m_-1325830981210329137divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b>
<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.<wbr>harvard.edu</a> &lt;<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.<wbr>harvard.edu</a>&gt; on behalf
 of Alexandre Gramfort &lt;<a href="mailto:alexandre.gramfort@inria.fr" target="_blank">alexandre.gramfort@inria.fr</a>&gt;<br>
<b>Sent:</b> Wednesday, March 28, 2018 3:32:34 AM<br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Subject:</b> Re: [Mne_analysis] The problem with saving morphed labels to an annot file</font>
<div>&nbsp;</div>
</div>
<div>
<div class="x_h5">
<div class="x_m_-1325830981210329137BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="x_m_-1325830981210329137PlainText">hi Noam,<br>
<br>
I personally don't have a solution for this. Maybe someone else?<br>
<br>
could you provide a code snippet to replicate the pb?<br>
<br>
Alex<br>
<br>
<br>
On Wed, Mar 28, 2018 at 4:24 AM, Peled, Noam &lt;<a href="mailto:NPELED@mgh.harvard.edu" target="_blank">NPELED@mgh.harvard.edu</a>&gt; wrote:<br>
&gt; Dear group,<br>
&gt;<br>
&gt; It seems like an old problem, but I couldn't find a reasonable solution,<br>
&gt;<br>
&gt; When morphing labels from fsaverage to a subject, in most cases the annot<br>
&gt; file cannot be written due to vertices that belong to more than one label.<br>
&gt;<br>
&gt; I've implemented several solutions, but in some cases, none of them gives a<br>
&gt; reasonable result.<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Noam<br>
&gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; Mne_analysis mailing list<br>
&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.<wbr>edu</a><br>
&gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">
https://mail.nmr.mgh.harvard.<wbr>edu/mailman/listinfo/mne_<wbr>analysis</a><br>
&gt;<br>
&gt;<br>
&gt; The information in this e-mail is intended only for the person to whom it is<br>
&gt; addressed. If you believe this e-mail was sent to you in error and the<br>
&gt; e-mail<br>
&gt; contains patient information, please contact the Partners Compliance<br>
&gt; HelpLine at<br>
&gt; <a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/<wbr>complianceline</a> . If the e-mail was sent to you in<br>
&gt; error<br>
&gt; but does not contain patient information, please contact the sender and<br>
&gt; properly<br>
&gt; dispose of the e-mail.<br>
&gt;<br>
______________________________<wbr>_________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.<wbr>edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.<wbr>edu/mailman/listinfo/mne_<wbr>analysis</a><br>
</div>
</span></font></div>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.<wbr>edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.<wbr>edu/mailman/listinfo/mne_<wbr>analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/<wbr>complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</body>
</html>