[Mne_analysis] Differences between command line and python?

Cushing, Cody CCUSHING1 at mgh.harvard.edu
Thu Apr 7 12:42:51 EDT 2016
Search archives:

Hi Alex,

Thanks for the reply.  I'm happy to provide whatever additional details, I just didn't want to bloat the original email too much.  

So, I switched to 'meg=True' in my picks, but it didn't change the end result.  Also, just so its clear, I have all the mags listed in the bad channel file to essentially pick grads for the batch version, so all mags are excluded in both streams.

And I do really want my tmax at 0.06 since there is a 60ms delay on our projector here, so time 0.06s is my true time 0s in the epoch. bmax is set at 0.06 in the .ave/.cov txt file as well (batch bmax equals python tmax for the covariance computation, yes? the .cov txt file has the user define the tmin/tmax of the epoch [-.03 1.0] as well as the bmin/bmax for the computation.

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 telecom-paristech.fr]
Sent: Thursday, April 07, 2016 12:18 PM
To: Discussion and support forum for the users of MNE Software
Subject: Re: [Mne_analysis] Differences between command line and python?

I miss some details but at first sight meg='grad' could be the error.
Can you try with meg='True'

next test is to make sure you really want to do:

cov=mne.compute_covariance(epochs, tmin=-0.03, tmax=0.06);

and not

cov=mne.compute_covariance(epochs, tmin=-0.03, tmax=0);

to be checked in the .ave txt file you used with the command line.


On Thu, Apr 7, 2016 at 4:32 PM, Cushing, Cody <CCUSHING1 at mgh.harvard.edu> wrote:
> Hi all,
> I've been noticing some pretty serious differences in dSPM values as I
> transfer my dataset from the batch stream to the python stream.  I believe
> these differences are related to the computation of the noise covariance
> matrix.  Can anyone tell me the difference between implementing either of
> these on the same raw file with the same bad channels marked and the same
> events file:
> mne_process_raw --raw $rawfile1 --digtrig STI101 --projon --cov $covfile
> --ave $avefile --events $eventfile --allevents --filteroff --saveavetag
> "_cmdtest-ave" --savecovtag "_cmdtest-cov"
> with rejection parameters identical to below.  In the .ave & .cov files:
> tmin, tmax = -0.03, 1.0  bmin, bmax = -.03, .06
> versus implementing this in python:
> picks = mne.pick_types(raw.info, meg='grad', eeg=False, stim=False,
> eog=True,
>                        include=include, exclude='bads')
> epochs = mne.Epochs(raw, events, event_id, tmin, tmax, picks=picks,
>                     baseline=(-0.03, 0.06), reject=dict(grad=2000e-13,
> eog=800e-6),
>                     preload=False, proj=True)
>     epochs.drop_bad_epochs()
> cov=mne.compute_covariance(epochs, tmin=-0.03, tmax=0.06);
>     mne.write_cov(cov2save,cov);
> evoked =
> [epochs['1'].average(),epochs['2'].average(),epochs['3'].average(),epochs['4'].average(),epochs['5'].average(),epochs['6'].average(),epochs['7'].average(),epochs['8'].average(),epochs['9'].average
> (),epochs['10'].average(),epochs['11'].average(),epochs['12'].average()]
>    mne.write_evokeds(fname2save, evoked)  # save evoked data to disk
> Because as far as I can tell they seem to be doing the same thing?  But
> there's some pretty stark differences in the SNR estimate and dSPM values
> after putting both -ave.fif & -cov.fif files through the same fwd/inverse
> solution commands based on the same source space for things as simple as the
> initial response in the visual cortex (that I'd be happy to share with
> whoever, I just wanted to make sure some silly option wasn't off that was
> throwing everything off).
> Thanks for any help.
> Cheers,
> Cody
> _______________________________________________
> 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

More information about the Mne_analysis mailing list