[Mne_analysis] Cortical labels power spectrum different approaches

Peled, Noam NPELED at mgh.harvard.edu
Fri Aug 31 15:02:16 EDT 2018
Search archives:

Hey all, thanks to Denis, it seems that setting the pick_ori to 'normal' in apply_inverse_epochs did the trick.

Also, in both cases I added:

psd_avg = 10 * np.log10(psd_avg)

To convert the results to [dB].

Now, the two power spectrums are much more similar, but the values in compute_source_psd_epochs are bigger (see attached).


Thanks Denis!

Noam

________________________________
From: mne_analysis-bounces at nmr.mgh.harvard.edu <mne_analysis-bounces at nmr.mgh.harvard.edu> on behalf of Sheraz Khan, PhD <sheraz at nmr.mgh.harvard.edu>
Sent: Friday, August 31, 2018 8:47:29 AM
To: Discussion and support forum for the users of MNE Software
Cc: Discussion and support forum for the users of MNE Software
Subject: Re: [Mne_analysis] Cortical labels power spectrum different approaches

We can debug it together today and update the mailing list.

Sheraz


> Hey Alex,
>
> Yes, you can find the script
> here<https://github.com/pelednoam/mmvt/blob/master/src/misc/power_spectral_density.py>.
>
> It's based on this mne
> example<https://martinos.org/mne/stable/auto_examples/time_frequency/plot_compute_source_psd_epochs.html>.
>
> One thing the pops immediately, is that only on the second approach
> (psd_array_multitaper on the label_ts) you need to set the mode (I set it
> to mean_flip)
>
> Also, for both of them, I use 10 * np.log10(x) to get dB. Not sure this
> correct in the first approach, mostly because it's not part of the mne
> example.
>
>
> Thanks,
>
> Noam
>
> ________________________________
> From: mne_analysis-bounces at nmr.mgh.harvard.edu
> <mne_analysis-bounces at nmr.mgh.harvard.edu> on behalf of Alexandre Gramfort
> <alexandre.gramfort at inria.fr>
> Sent: Thursday, August 30, 2018 9:27:59 AM
> To: Discussion and support forum for the users of MNE Software
> Subject: Re: [Mne_analysis] Cortical labels power spectrum different
> approaches
>
>         External Email - Use Caution
>
> hi,
>
> It should be more in agreement.
> Can you share a script on one of the MNE datasets to figure out the
> cause of the difference?
> Also note that both units in your plots are very different (dB vs I am not
> sure)
>
> Alex
>
> On Wed, Aug 29, 2018 at 11:18 PM Peled, Noam <NPELED at mgh.harvard.edu>
> wrote:
>>
>> Let me be more specific/clear:
>>
>> I'm analyzing data from a patient with an ECOG. I want to compare the
>> power-spectrum of the electrodes and the MEG cortical labels I've
>> created around each electrode.
>>
>> It seems that calculating the time series in the source space of long
>> enough MEG epochs (~10s), split the electrodes file to same length
>> epochs, and use
>>
>> mne.time_frequency.psd_array_multitaper on both of them is the way to
>> go, and also I know that both are in the same units (10*log10 for [dB]).
>> But I'm still a little bit confused by the different results I'm getting
>> when using mne.minimum_norm.compute_source_psd_epochs instead.
>>
>> Thanks,
>> Noam
>>
>> ________________________________
>> From: mne_analysis-bounces at nmr.mgh.harvard.edu
>> <mne_analysis-bounces at nmr.mgh.harvard.edu> on behalf of Peled, Noam
>> <NPELED at mgh.harvard.edu>
>> Sent: Wednesday, August 29, 2018 2:32:39 PM
>> To: mne_analysis at nmr.mgh.harvard.edu
>> Subject: [Mne_analysis] Cortical labels power spectrum different
>> approaches
>>
>>
>> Hey all,
>>
>> I'm calculating MEG cortical labels power spectrum (for resting state
>> data) in two different ways. Can you help me understand the differences?
>> The power spectrums are quite different (see attached).
>>
>>
>> 1) Go through the source space time-series:
>>
>>
>> stcs = mne.minimum_norm.apply_inverse_epochs(epochs, ...)
>> labels_ts = mne.extract_label_time_course(stcs, labels, ...)
>> for label_ts:
>>   psds, freqs = mne.time_frequency.psd_array_welch(label_ts, ...)
>>   psds = 10 * np.log10(psds)
>>
>>
>> 2) Compute the PSD from the epochs:
>>
>>
>> for label_ind, label in enumerate(labels):
>>   stcs = mne.minimum_norm.compute_source_psd_epochs(epochs, ...)
>>   for stc in stcs:
>>     psds = np.mean(stc.data, axis=0)
>>
>>
>>
>> Thanks!
>>
>> Noam
>>
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>
>>
>> The information in this e-mail is intended only for the person to whom
>> it is
>> addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you
>> in error
>> but does not contain patient information, please contact the sender and
>> properly
>> dispose of the e-mail.
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis


-------------------------
Sheraz Khan, M.Eng, Ph.D.
Instructor in Radiology

Athinoula A. Martinos Center for Biomedical Imaging
Massachusetts General Hospital
Harvard Medical School

McGovern Institute for Brain Research
Massachusetts Institute of Technology

Tel:   +1 617-643-5634
Fax:   +1 617-948-5966
Email: sheraz at nmr.mgh.harvard.edu
       sheraz at mit.edu
Web:   http://sheraz.mit.edu
_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180831/c789768b/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: power_spectrum_comp.png
Type: image/png
Size: 42961 bytes
Desc: power_spectrum_comp.png
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180831/c789768b/attachment-0001.png 


More information about the Mne_analysis mailing list