[Mne_analysis] single trial dSPM plots

Alexandre Gramfort alexandre.gramfort at telecom-paristech.fr
Sat Apr 26 09:35:41 EDT 2014
Search archives:

New example will show up on the dev website tomorrow

thanks Hari

Alex

cf : https://github.com/mne-tools/mne-python/pull/1237


On Fri, Apr 25, 2014 at 1:34 AM, Matt Erhart <mattjerhart at gmail.com> wrote:
> Great example! It's working now for my data.
>
>
> On Wed, Apr 23, 2014 at 2:33 PM, Hari Bharadwaj <hari at nmr.mgh.harvard.edu>
> wrote:
>>
>> Hi Matt,
>>    Please have a try with this:
>> https://gist.github.com/haribharadwaj/11232865
>>
>> Here, the single trial dSPM and the evoked dSPM are shown from the same
>> label (pooled across vertices of the label).. I have used the same inverse
>> operator for the two (i.e., scaled the noise-cov identically).. Not sure
>> if this is representative of "current thinking" but nonetheless something
>> I look at for exploratory purposes when I want to view single trials..
>>
>> Hari
>>
>>
>> On Wed, April 23, 2014 3:11 pm, Matt Erhart wrote:
>> > It would be great to get a inverse epochs example that reflects the
>> > current
>> > thinking in single trial localization, especially one that shows the
>> > best
>> > way organize, scale, and display the single trials. Ultimately, I just
>> > want
>> > to do some stats between conditions for single subjects or to plot sem
>> > around an average condition waveform for a subject, so including that
>> > kind
>> > of thing would be even better.
>> >
>> >
>> > On Wed, Apr 23, 2014 at 11:30 AM, Tal Linzen <tal.linzen at gmail.com>
>> > wrote:
>> >
>> >> I feel like the recommendation to use MNE instead of dSPM in
>> >> single-trial
>> >> source solutions has come up on the mailing list more than once, I
>> >> think,
>> >> but the example code distributed with MNE Python still uses dSPM:
>> >>
>> >>
>> >>
>> >> http://martinos.org/mne/stable/auto_examples/inverse/plot_compute_mne_inverse_epochs_in_label.html
>> >>
>> >>
>> >> On Mon, Apr 21, 2014 at 3:21 PM, dgw <dgwakeman at gmail.com> wrote:
>> >>
>> >>> Hi Matt,
>> >>>
>> >>> I am unsure if this is a scaling problem. Remember the dSPM is
>> >>> essentially an F test against the noise. The brain is very busy all
>> >>> the time, so your SNR is pretty low, because you are only interested
>> >>> in the activity relative to your task, while all that other brain
>> >>> activity is going on in the single trial data. Averaging dramatically
>> >>> improves the SNR.
>> >>>
>> >>> Short version: If you are use the dSPM, I expect the single trial to
>> >>> look very poor (especially if you are using prestimulus data for the
>> >>> noise covariance matrix). It may make more sense to look at single
>> >>> trial data using the MNE. And if you really must use single trial data
>> >>> with a dSPM, I recommend using emptyroom data (if this is MEG) instead
>> >>> of prestimulus data for your noise covariance matrix.
>> >>>
>> >>> I don't think it would be a problem for a figure to show the average
>> >>> dSPM and the single trial MNE (with two y axes: the left with the dSPM
>> >>> score and the right with the MNE amplitudes for the single trial
>> >>> data).
>> >>>
>> >>> HTH
>> >>> D
>> >>>
>> >>> On Mon, Apr 21, 2014 at 3:08 PM, Matt Erhart <merhart at ucsd.edu> wrote:
>> >>> > How should I scale single trial dspm timecourses (from a label) so
>> >>> they
>> >>> can
>> >>> > be plotted together with the average across trials? Currently, my
>> >>> average
>> >>> > across trials looks good, but the single trials don't seem to match
>> >>> the
>> >>> > average, so I assume I am scaling the single trials wrong. Here's
>> >>> > the
>> >>> > plotting code snippet:
>> >>> >
>> >>> > ...
>> >>> > #left/right tones
>> >>> > stcs_RL = apply_inverse_epochs(epochs_ica['RL'], inverse_operator,
>> >>> lambda2,
>> >>> > method,
>> >>> >                             pick_ori="normal")
>> >>> >
>> >>> > #https://gist.github.com/dengemann/9470121
>> >>> > times = epochs_ica.times * 1e3
>> >>> > def xfun(x, times):
>> >>> >     x = np.abs(x).mean(0)
>> >>> >     baseline = times < 0
>> >>> >     x -= x[baseline].mean(0)[None]
>> >>> >     x /= x[baseline].std(0)[None]
>> >>> >     return x
>> >>> >
>> >>> > mean_stc2 = sum(stcs_LR[:])
>> >>> > mean_stc2._data /= len(stcs_LR[:])
>> >>> >
>> >>> > for i in range(np.shape(stcs_LR)[0]):
>> >>> >     time_course2 = xfun(stcs_LR[i].in_label(label).data, times)
>> >>> >     plt.plot(times, time_course2)
>> >>> >     plt.xlabel('Time (ms)')
>> >>> >
>> >>> > mean_timecourse = xfun(mean_stc2.in_label(label).data, times)
>> >>> > plt.plot(times,mean_timecourse.T,linewidth=5)
>> >>> >
>> >>> > Here's a image of the single trials under the average across trials.
>> >>> They
>> >>> > don't seem to match up but the average is what I would expect.
>> >>> >
>> >>> > If there was a gist around somewhere that shows how to plot single
>> >>> trials
>> >>> > from a label and the average together correctly, that'd be great.
>> >>> >
>> >>> > thanks,
>> >>> > Matt
>> >>> >
>> >>> > _______________________________________________
>> >>> > 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
>> >>
>> >>
>> >> 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
>>
>>
>> --
>> Hari Bharadwaj
>> PhD Candidate, Biomedical Engineering,
>> Boston University
>> 677 Beacon St.,
>> Boston, MA 02215
>>
>> Martinos Center for Biomedical Imaging,
>> Massachusetts General Hospital
>> 149 Thirteenth Street,
>> Charlestown, MA 02129
>>
>> hari at nmr.mgh.harvard.edu
>> Ph: 734-883-5954
>>
>>
>> _______________________________________________
>> 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
>
>
> 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.
>



More information about the Mne_analysis mailing list