[Mne_analysis] Differences between command line and python?

Alexandre Gramfort alexandre.gramfort at telecom-paristech.fr
Thu Apr 7 12:18:14 EDT 2016
Search archives:

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.

Alex

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


More information about the Mne_analysis mailing list