<p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p><div dir="ltr"><div style="color:rgb(0,0,0);font-family:Consolas,sans-serif;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Thanks, Eric!</div><div style="color:rgb(0,0,0);font-family:Consolas,sans-serif;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">And I understand the vertices locations are unique for each subject, and thus we need to include the subjects paths. Is this correct? What if it was an averaged STC (if it can be)? What shall we use as the &quot;subject path&quot; arguments?</div><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>Thank you, </div><div>Ade</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Thu, 10 May 2018 09:29:22 -0400<br>
From: Eric Larson &lt;<a href="mailto:larson.eric.d@gmail.com">larson.eric.d@gmail.com</a>&gt;<br></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If you already have a STC, doing:<br>
<br>
left_mni = mne.vertex_to_mni(stc.<wbr>vertices[0], 0)<br>
right_mni = mne.vertex_to_mni(stc.<wbr>vertices[1], 1)<br>
<br>
?<br>
might do it.<br>
<br>
Eric<br>
<br>
<br>
On Thu, May 10, 2018 at 4:05 AM, Adela Glez. &lt;<a href="mailto:adelaglezcom@gmail.com">adelaglezcom@gmail.com</a>&gt; wrote:<br>
<br>
&gt;         External Email - Use Caution<br>
&gt;<br>
&gt; Thanks, Alex.<br>
&gt;<br>
&gt; Since I don&#39;t know how to write python code (I work with Matlab), I want<br>
&gt; to do my statistical analysis in Matlab. But first I need to have the data<br>
&gt; in MNI coordinates. I need a piece of Python code that gives me the MNI<br>
&gt; coordinates for the source locations for each subject. The only code I<br>
&gt; could find is this, which calculates MNI coordinates of center of mass. How<br>
&gt; to modify this to give me instead the stc locations?<br>
&gt;<br>
&gt; # calculate center of mass and transform to mni coordinatesvtx, _, t_lh = stc_lh.center_of_mass(&#39;sample&#39;<wbr>)mni_lh = mne.vertex_to_mni &lt;<a href="https://martinos.org/mne/stable/generated/mne.vertex_to_mni.html#mne.vertex_to_mni" rel="noreferrer" target="_blank">https://martinos.org/mne/<wbr>stable/generated/mne.vertex_<wbr>to_mni.html#mne.vertex_to_mni</a>&gt;<wbr>(vtx, 0, &#39;sample&#39;)[0]vtx, _, t_rh = stc_rh.center_of_mass(&#39;sample&#39;<wbr>)mni_rh = mne.vertex_to_mni &lt;<a href="https://martinos.org/mne/stable/generated/mne.vertex_to_mni.html#mne.vertex_to_mni" rel="noreferrer" target="_blank">https://martinos.org/mne/<wbr>stable/generated/mne.vertex_<wbr>to_mni.html#mne.vertex_to_mni</a>&gt;<wbr>(vtx, 1, &#39;sample&#39;)[0]<br>
&gt;<br>
&gt;<br>
&gt; Thanks again,<br>
&gt; Adela<br>
&gt;<br>
&gt; On 10 May 2018 at 08:37, &lt;<a href="mailto:mne_analysis-request@nmr.mgh.harvard.edu">mne_analysis-request@nmr.mgh.<wbr>harvard.edu</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;    1. Re: How to obtain MNI coords using mne.vertex_to_mni      (newbie)<br>
&gt;&gt;       (Alexandre Gramfort)<br>
&gt;<br>
&gt;  ----------<br>
&gt;&gt; From: Alexandre Gramfort &lt;<a href="mailto:alexandre.gramfort@inria.fr">alexandre.gramfort@inria.fr</a>&gt;<br>
&gt;&gt; Subject: Re: [Mne_analysis] How to obtain MNI coords using<br>
&gt;&gt;         mne.vertex_to_mni       (newbie)<br>
&gt;&gt; To: Discussion and support forum for the users of MNE Software<br>
&gt;&gt;         &lt;<a href="mailto:mne_analysis@nmr.mgh.harvard.edu">mne_analysis@nmr.mgh.harvard.<wbr>edu</a>&gt;<br>
&gt;&gt; Message-ID:<br>
&gt;&gt;         &lt;<wbr>CADeotZr4Z0oa7QWVitPPGRCzaKBe-<wbr>ju7ngOckTUSL=<a href="mailto:N0fOqxhw@mail.gm">N0fOqxhw@mail.gm</a><br>
&gt;&gt; <a href="http://ail.com" rel="noreferrer" target="_blank">ail.com</a>&gt;<br>
&gt;&gt; Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
&gt;&gt;<br>
&gt;&gt;         External Email - Use Caution<br>
&gt;&gt;<br>
&gt;&gt; hi,<br>
&gt;&gt;<br>
&gt;&gt; what do you mean your MEG data?<br>
&gt;&gt;<br>
&gt;&gt; vertices here are SourceEstimate (aka stc) vertices.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; HTH<br>
&gt;&gt; Alex<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Thu, May 10, 2018 at 2:14 AM, Adela Glez. &lt;<a href="mailto:adelaglezcom@gmail.com">adelaglezcom@gmail.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; &gt;         External Email - Use Caution<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hi,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; In order to obtain the MNI coordinates of my MEG data, I have to use<br>
&gt;&gt; mne.vertex_to_mni.<br>
&gt;&gt; &gt; Could someone give me an example of its usage?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; As for the first argument, how to obtain the vertex numbers of my data?<br>
&gt;&gt; &gt; I&#39;m new in Python. Then, second argument, I can&#39;t find what code is<br>
&gt;&gt; right<br>
&gt;&gt; &gt; or left hemisphere. Is there a way to get in one output both hemispheres<br>
&gt;&gt; &gt; (=the whole brain)?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thank you,<br>
&gt;&gt; &gt; Adela<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This is the help of the function:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; mne.vertex_to_mni(*vertices*, *hemis*, *subject*, *subjects_dir=None*,<br>
&gt;&gt; &gt; *mode=None*, *verbose=None*)<br>
&gt;&gt; &gt; [source]<br>
&gt;&gt; &gt; &lt;<a href="http://github.com/mne-tools/mne-python/blob/master/doc/%3Cs" rel="noreferrer" target="_blank">http://github.com/mne-tools/<wbr>mne-python/blob/master/doc/%<wbr>3Cs</a><br>
&gt;&gt; tring%3E#L1129-L1187&gt;<br>
&gt;&gt; &gt; &lt;<a href="https://martinos.org/mne/dev/generated/mne.vertex_to_mni.ht" rel="noreferrer" target="_blank">https://martinos.org/mne/dev/<wbr>generated/mne.vertex_to_mni.ht</a><br>
&gt;&gt; ml#mne.vertex_to_mni&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Convert the array of vertices for a hemisphere to MNI coordinates.<br>
&gt;&gt; &gt; Parameters: *vertices* : int, or list of int<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Vertex number(s) to convert<br>
&gt;&gt; &gt; *hemis* : int, or list of int<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Hemisphere(s) the vertices belong to<br>
&gt;&gt; &gt; *subject* : string<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Name of the subject to load surfaces from.<br>
&gt;&gt; &gt; *subjects_dir* : string, or None<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Path to SUBJECTS_DIR if it is not set in the environment.<br>
&gt;&gt;<br>
&gt;<br>
</blockquote></div><br></div></div>