[Mne_analysis] single trial dSPM plots

dgw dgwakeman at gmail.com
Mon Apr 21 15:21:09 EDT 2014
Search archives:

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.
>



More information about the Mne_analysis mailing list