<div dir="ltr">I&#39;m actually not sure. Perhaps Matti has some idea?<div><br></div><div>My gut feeling is that the initial investment to get it working in Python would be worth the reduced future burden of debugging, repair, and maintenance. But somebody needs to be willing to put in the time to get it working, and that could take a good chunk time.</div><div><br></div><div>Eric</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 28, 2015 at 11:48 AM, Per Arnold Lysne <span dir="ltr">&lt;<a href="mailto:lysne@unm.edu" target="_blank">lysne@unm.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Eric,</p>
<p><br>
</p>
<p>    How difficult do you think it would be to repair the &#39;C&#39; version? Thanks again,</p>
<p><br>
</p>
<p>-Per</p>
<p><br>
</p>
<div style="color:rgb(33,33,33)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><span class=""><b>From:</b> <a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a> &lt;<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a>&gt; on behalf of Eric Larson &lt;<a href="mailto:larson.eric.d@gmail.com" target="_blank">larson.eric.d@gmail.com</a>&gt;<br>
</span><b>Sent:</b> Tuesday, April 28, 2015 11:12 AM<div><div class="h5"><br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Subject:</b> Re: [Mne_analysis] mne_setup_source_space with --morph option =&gt; morphing fsaverage onto subject</div></div></font>
<div> </div>
</div><div><div class="h5">
<div>
<div dir="ltr">If you have time, you could try implementing the `morph` option in mne-python. I don&#39;t think it will be easy, but we&#39;re happy to help as much as we can.
<div><br>
</div>
<div>Eric</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Apr 28, 2015 at 10:08 AM, Per Arnold Lysne <span dir="ltr">
&lt;<a href="mailto:lysne@unm.edu" target="_blank">lysne@unm.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Eric,</p>
<p><br>
</p>
<p>    Thank you for your explanation (and thanks to Denis and Matthias for their replies as well). It appears that morphing does work as I understood.</p>
<p><br>
</p>
<p>    I have developed a group version of the mixed_norm sparse localizer, and so I need all of my subjects to be in a common source space early in the analysis (i.e. I cannot use data morphing on the individual stcs). I have been trying to use mne_setup_source_space
 --subject MySubject --morph fsaverage but to date this is failing with a &quot;double occupation&quot; error. I may have to cross my fingers and hope this gets resolved.</p>
<p><br>
</p>
<p>    Thanks again,</p>
<p><br>
</p>
<p>-Per</p>
<p><br>
</p>
<div style="color:rgb(33,33,33)">
<hr style="display:inline-block;width:98%">
<div dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b>
<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a> &lt;<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a>&gt; on behalf of Eric
 Larson &lt;<a href="mailto:larson.eric.d@gmail.com" target="_blank">larson.eric.d@gmail.com</a>&gt;<br>
<b>Sent:</b> Wednesday, April 22, 2015 6:53 PM
<div>
<div><br>
<b>To:</b> Discussion and support forum for the users of MNE Software<br>
<b>Subject:</b> Re: [Mne_analysis] mne_setup_source_space with --morph option =&gt; morphing fsaverage onto subject</div>
</div>
</font>
<div> </div>
</div>
<div>
<div>
<div>
<div dir="ltr">Hey Per,
<div><br>
</div>
<div>There are two different &quot;morph&quot; operations being talked about.</div>
<div><br>
</div>
<div>I have never morphed source spaces, but this is my understanding of how it works. Morphing source spaces means taking the subset of vertices from subject&#39;s A&#39;s brain mesh (typically white) that are in that subject&#39;s existing source space, and finding the
 vertices for subject B that are as close as possible based on A and B&#39;s spherical coregistration / morph map. In other words, the source space for subject B is created by subsampling subject B&#39;s high density cortical mesh vertices using the spherical-morphing
 correspondence of subject A&#39;s subsampled mesh. In physical space, the vertices from subject A could thus be in very different positions from their counterparts for subject B, but conceptually each vertex from subject A is intended to be in an equivalent anatomical
 location in subject B. Since subject A&#39;s source space was originally subdivided in a way that to some extent evenly subsampled its physical space, the differences in cortical folding between subjects A and B may result in subject B&#39;s (morphed) source space
 vertices having a spacing that is less uniform than a source space that was created for subject B directly. In this scheme, data does not need to be morphed between one subject and another, because the vertices in their source spaces are the same, anatomically
 speaking.</div>
<div><br>
</div>
<div>The other type of morphing is the one I talked about, data morphing. This is required when subject A has some source space created for it using any subsampling, and subject B has a source space created for it with any subsampling independently. The vertices
 from subject A were created independently from those in subject B (e.g., vertex 1 in A might map to 1093 in B, and 1093 in A might map to 5921 in B, etc.) There is a morphing procedure that allows you to map activity (i.e., source estimates) from subject A
 to subject B or vice-versa via a linear transformation. This transformation also makes use of the morph maps / spherical anatomical alignment of A and B, but it uses a smudging-like procedure to effectively push data from one subsampled mesh onto the other.
 This is also detailed in the manual somewhere. This is the procedure I am most familiar with -- create source space for each subject, arrive at source estimates for each subject in their own space, and for group analyses, use mne-python or MNE-C to morph all
 subjects&#39; data to fsaverage&#39;s ico-5 source space for analysis.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Eric</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Apr 22, 2015 at 4:40 PM, Denis-Alexander Engemann
<span dir="ltr">&lt;<a href="mailto:denis.engemann@gmail.com" target="_blank">denis.engemann@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">To elaborate on my note, this is what I do exactly to deal with this:
<div><br>
</div>
<div><a href="https://gist.github.com/dengemann/f90cf354816273fe87eb" target="_blank">https://gist.github.com/dengemann/f90cf354816273fe87eb</a><br>
</div>
<div><br>
</div>
<div>It&#39;s a genarator function that you can pass to `mne.connectivity.spectral_connectivity`</div>
<div><br>
</div>
<div>Hope this is useful for you,</div>
<div><br>
</div>
<div>Denis</div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-04-23 0:30 GMT+02:00 Per Arnold Lysne <span dir="ltr">
&lt;<a href="mailto:lysne@unm.edu" target="_blank">lysne@unm.edu</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello All,<br>
<br>
    Apologies for belaboring this thread - and thanks for everyone&#39;s useful comments. It appears that I may not understand the morphing option in mne_setup_source_space as well as I thought.<br>
<br>
    I understand Matthias&#39; original point of wanting to analyze individual subjects&#39; in a common, &quot;canonical&quot; source space. I had assumed that, when morphing was done in mne_setup_source_space (i.e. --subject MySubject --morph fsaverage), a common space would
 be the result (the fsaverage space) and that the forward and inverse operators would be adjusted to compensate for the changed cortical surface. In other words, there would be no loss of accuracy and that fsaverage would be the new, common source space. Am
 I missing something?<br>
<br>
    In reviewing the 2.7.3 manual I see a comment, &quot;The drawback of this approach is that the spacing between source locations in the “morph” subject is not going to be as uniform as it would be without morphing&quot; (under --morph, p22). Does this mean that the
 original subject&#39;s vertices are not being translated directly to those on fsaverage? In other words, although the new morphed surface may match fsaverage, there is not a common set of vertices shared between them?<br>
<br>
    (This complicates things for me because I am working on a group localization and am expecting the morphed individual subjects to have a common number of vertices in comparable locations.)<br>
<br>
    Thanks again,<br>
<span><br>
Per Lysne<br>
University of New Mexico<br>
<br>
</span>________________________________________<br>
From: <a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a> &lt;<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu" target="_blank">mne_analysis-bounces@nmr.mgh.harvard.edu</a>&gt; on behalf of
 Alexandre Gramfort &lt;<a href="mailto:alexandre.gramfort@telecom-paristech.fr" target="_blank">alexandre.gramfort@telecom-paristech.fr</a>&gt;<br>
Sent: Wednesday, April 22, 2015 7:48 AM<br>
To: Discussion and support forum for the users of MNE Software<br>
Subject: Re: [Mne_analysis] mne_setup_source_space with --morph option =&gt; morphing fsaverage onto subject<br>
<div>
<div><br>
hi Matthias,<br>
<br>
what you do makes sense and I would do the same.<br>
<br>
Not sure what&#39;s going wrong here. Maybe somebody has time<br>
to look at this problem with the triangles.<br>
<br>
Alex<br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_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" target="_blank">http://www.partners.org/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>
<br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_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" target="_blank">http://www.partners.org/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>
</div>
</div>
</div>
<br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_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" target="_blank">http://www.partners.org/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></div>
</div>
</div>

<br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_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" target="_blank">http://www.partners.org/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>