<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>Thank you so much!</div><div>It was very helpful.</div><div>Best,</div><div>Irina.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 17, 2019 at 7:21 PM Eric Larson &lt;<a href="mailto:larson.eric.d@gmail.com">larson.eric.d@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)">        External Email - Use Caution        </span></p><p></p><div dir="ltr">If you just want to visualize these, you can use add_foci for the Brain object in PySurfer:<div><br></div><div><a href="https://pysurfer.github.io/generated/surfer.Brain.html#surfer.Brain.add_foci" target="_blank">https://pysurfer.github.io/generated/surfer.Brain.html#surfer.Brain.add_foci</a><br></div><div><br></div><div>But you&#39;ll probably want to plot using the `white` surface, assuming that&#39;s what you used for source localization, otherwise the location won&#39;t make much sense.</div><div><br></div><div>If you want the vertex number, you can load the fsaverage/surf/lh.white and/or rh.white surfaces using `mne.read_surface`, and find the index/vertex number of the nearest surface vertex to each of your x/y/z points. Once you have this, you can use `add_foci` with `coords_as_verts=True` and pass the vertex number -- and this will work regardless of which surface you&#39;re using to plot.</div><div><br></div><div>Eric</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 17, 2019 at 10:12 AM Irina Anurova &lt;<a href="mailto:anurova.irina@gmail.com" target="_blank">anurova.irina@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)">        External Email - Use Caution        </span></p><p></p><div dir="ltr"><div>Dear Alexandre,</div><div>Is there a way to convert MNI coordinates TO the vertex number? I have group mean x, y, z values for different experimental conditions, and I would like to show them on the standard (fsaverage) brain. <br></div><div>Thank you very much for your kind help,</div><div>Irina.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 6, 2019 at 8:22 PM Irina Anurova &lt;<a href="mailto:anurova.irina@gmail.com" target="_blank">anurova.irina@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thank you so much for your help!</div><div>Everything works fine.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 6, 2019 at 3:09 PM Alexandre Gramfort &lt;<a href="mailto:alexandre.gramfort@inria.fr" target="_blank">alexandre.gramfort@inria.fr</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)">        External Email - Use Caution        </span></p><p></p><div dir="ltr">hi Irina,<div><br></div><div>indeed. I thought it was STC objects. You need to apply the morph to the stcs</div><div>to get the source estimates on fsaverage (or your average subject).</div><div><br></div><div>maybe this can help <a href="https://mne.tools/stable/auto_examples/inverse/plot_morph_surface_stc.html?highlight=morph" target="_blank">https://mne.tools/stable/auto_examples/inverse/plot_morph_surface_stc.html?highlight=morph</a></div><div><br></div><div>Alex</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 6, 2019 at 12:38 PM Irina Anurova &lt;<a href="mailto:anurova.irina@gmail.com" target="_blank">anurova.irina@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)">        External Email - Use Caution        </span></p><p></p><div dir="ltr"><div>I am very sorry for bothering you again,</div><div>I tried both options, and got the same error message:</div><div>TypeError: unsupported operand type(s) for +: &#39;SourceMorph&#39; and &#39;SourceMorph&#39;</div><div><br></div><div>Possibly, there was a mistake in morphing procedure.<br></div><div><br></div><div>1. I downloaded individual stcs:  <br></div><div>stc = mne.read_source_estimate()</div><div>2. I computed morphed stcs:</div><div>morph = mne.compute_source_morph(stc, subject_from=subject_name, subject_to=&#39;fsaverage&#39;, subjects_dir=subjects_dir)</div><div>3. saved them as *.h5:</div><div>morph.save()</div><div>4. Then I download all morphed stcs:</div><div>morphS1 = mne.read_source_morph(fileFolderSTC_morph + &#39;S1_stc-morph.h5&#39;)</div><div>morphS2=.........</div><div>5. and then tried to average:<br></div><div>
grand_average = (morphS1 + morphS2 + morphS3 + morphS4) / 4 <br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 5, 2019 at 10:17 PM Alexandre Gramfort &lt;<a href="mailto:alexandre.gramfort@inria.fr" target="_blank">alexandre.gramfort@inria.fr</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p><span style="padding:3px 10px;border-radius:5px;color:rgb(255,255,255);font-weight:bold;display:inline-block;background-color:rgb(255,0,0)">        External Email - Use Caution        </span></p><p></p><div dir="ltr"><div>hi Irina,</div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I tried this:</div><div>morph_group = [morphS1, morphS2, morphS3, morphS4]<br>grand_average = mne.SourceEstimate.mean(morph_group)</div><div><br></div><div>returns error: &quot;AttributeError: &#39;list&#39; object has no attribute &#39;sum&#39;&quot;<br></div></div></blockquote><div><br></div><div>you can do arithmetic with stcs</div><div><br></div><div>you can do:</div><div><br></div><div>grand_average = (morphS1 + morphS2 + morphS3 + morphS4) / 4</div><div><br></div><div>and this should work</div><div><br></div><div>all_stcs = [morphS1, morphS2, morphS3, morphS4]</div><div>grand_average = sum(all_stcs) / len(all_stcs)<br></div><div><br></div><div>HTH</div><div>Alex</div><div> </div></div></div>
_______________________________________________<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" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote></div>
_______________________________________________<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" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote></div>
_______________________________________________<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" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote></div>
</blockquote></div>
_______________________________________________<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" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote></div>
_______________________________________________<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" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a></blockquote></div>