<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I fixed the error by using:<br><br>stc._data = stc.data[:,0:1]  # First column of sources, instead of stc.data[:,0] which gives wrong dimensions.<br><br>stc.times = stc.times[0:1]  # Extract the first frequency, preserving the array format (instead of stc.times[0], which is a single number).<br></div># (Multiply this by 1000 to get frequency in Hz because compute_source_psd converts time into milliseconds)<br><br></div><div>Now mne.viz.plot_source_estimates(stc,...) produces a plot on the brain at a single frequency.<br></div><br>Could anyone explain why MNE should be used instead of dSPM to get the power plots? The tutorial on the MNE website says to use dSPM as the solver.<br><br></div>Thanks and Best,<br></div>Gladia<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 1, 2016 at 10:10 AM, Gladia Hotan <span dir="ltr">&lt;<a href="mailto:gladiach@gmail.com" target="_blank">gladiach@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"><div><div><div><div><div><div>Hi Denis,<br><br></div>I tried replacing stc.data and stc.times as such:<br><br></div>stc._data = stc.data[0]  # Just look at the first frequency<br></div>stc.times = stc.times[0]<br><br></div>But trying to plot this gives &#39;ValueError: dimension mismatch&#39;. Could you explain a bit more about how I should hack the stc object? Also, how do I figure out how much to scale the data by?<br><br></div>Thank you and Best Regards,<br></div>Gladia<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 30, 2016 at 4:55 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">I can answer in greater detail later, but 1) you need to &quot;hack&quot; the stc object and figure out the right scale after putting the frequenies in .times and accordingly scale ; by default our data containers assume time domain data 2) if you use dSPM as method it is a pseudo F-statistic, for interpretable power plots you should use MNE as method in the inverse solver <br><br>I hope this helps a bit,<br><br>Denis<br><div class="gmail_quote"><span><div dir="ltr">On Thu, 30 Jun 2016 at 22:49, Gladia Hotan &lt;<a href="mailto:gladiach@gmail.com" target="_blank">gladiach@gmail.com</a>&gt; wrote:<br></div></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><div dir="ltr"><div><span style="font-family:arial,helvetica,sans-serif">Hi,<br><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">I have a couple of questions about the psd of sources:<br></span></div><div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><span style="font-family:arial,helvetica,sans-serif">1) I used <br></span><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:9.6pt"><span style="font-family:arial,helvetica,sans-serif">stc = mne.minimum_norm.compute_source_psd<br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:9.6pt"><span style="font-family:arial,helvetica,sans-serif">to get an stc file containing the psd of the sources. It seems like in this stc file, <br>frequency has replaced time, but is still called &#39;time&#39;:<br><br>&lt;SourceEstimate  |  ... tmin : 0.0 (ms), tmax : 55.0 (ms), tstep : 0.25 (ms) ...&gt;<br><br>(I set the function to compute from 0 to 55 Hz; the time duration of the data is<br>actually a lot longer). I can use stc.plot or mne.plot_source_estimates to visualize this, but it treats <br>the frequencies like times. How can I plot the psd at a particular frequency on the brain? <br><br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:9.6pt"><span style="font-family:arial,helvetica,sans-serif">2) What are the units of the psd of the sources? According to the <a href="http://martinos.org/mne/stable/auto_examples/time_frequency/plot_source_power_spectrum.html#sphx-glr-auto-examples-time-frequency-plot-source-power-spectrum-py" target="_blank">tutorial</a> the psd is in dB,<br>but what is the reference quantity being used when converting to dB? (Ie. what is Pref in P_db = 10*log10(P/Pref)?)<br>Am I right that the source amplitudes are in units of ampere-metres?<br></span></pre><pre style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:&quot;DejaVu Sans Mono&quot;;font-size:9.6pt"><span style="font-family:arial,helvetica,sans-serif">Thanks and Best,<br>Gladia</span><br></pre></div></span>
_______________________________________________<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><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/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>
</blockquote></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" rel="noreferrer" 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" rel="noreferrer" 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></blockquote></div><br></div>