[Mne_analysis] . Re: Computer forward solution using epoch.info rather than

FAIRS Amie amie.FAIRS at univ-amu.fr
Thu Jul 23 05:25:39 EDT 2020
Search archives:

        External Email - Use Caution        

Thanks! Unfortunately my VM just crashed so I'll test this out at a later date. Relatedly, and I think I have done this wrong - I already have cleaned epoched data that I have been using rather than epoching the raw data for noise_cov. But actually I think I want the raw data that is epoched, but not actually cleaned, for noise covariance? Having run ICA and autoReject to clean the data and repair channels then probably isn't the best to estimate noise covariance (or am I wrong)?



Dr. Amie Fairs
Aix-Marseille Université
Laboratoire Parole et Langage (LPL) | CNRS UMR 7309 | 5 Avenue Pasteur | 13100 Aix-en-Provence
Email : amie.fairs at univ-amu.fr

While I may send this email outside of typical working hours, I have no expectation to receive an email outside of your typical hours.


Message: 1
Date: Tue, 21 Jul 2020 14:04:44 -0400
From: Eric Larson <larson.eric.d at gmail.com>
Subject: Re: [Mne_analysis] Computer forward solution using epoch.info
	rather than raw.info {Disarmed}
To: Discussion and support forum for the users of MNE Software
	<mne_analysis at nmr.mgh.harvard.edu>
	<CAGu2niVPtufM8478Womjk-FQ8wbZMZ5LP8u0BZDQqWiSgAwnaA at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

This message contained a link to a web site whose IP address has recently been associated with malicious activity.  Due to that activity, the site is not accessible from within the Partners Healthcare network.  The link has been modified in the message below.  If you feel this is an error, please contact the IS Service Desk and open a ticket with the network security - phs assignment group.

                                  IS Service Desk
BWH  617-732-5927    BWFH  617-983-7454    BWH-RICS  617-525-0848
DFCI  617-632-3399    LCC  857-307-4150       MCL  781-416-8940
MGH  617-726-5085    NHP  617-643-2020       NSMC  978-354-2014
NWH  617-243-6001    PCPO  781-433-3757    PHH  617-726-0790
PHS  857-282-4357     SRN  617-952-5555      CDHC  413-582-5005

        External Email - Use Caution        

> I?m currently running source recon MEG data using individual MRIs. I 
> found that when running make_inverse_operator(raw.info, fwd, 
> noise_cov) I was getting an error saying ?no channels match the 
> selection?. I checked in raw.info and no channels were marked as bad, 
> so I tried again using epoch.info (also no bad channels) instead of 
> raw.info and got the same error.

raw.ch_names, fwd['ch_names'], and/or noise_cov['names'] must not match.
This suggests that something is going wrong in your pipeline as these should all be consistent.

> I have diagnosed this further up the pipeline ? I was making the 
> forward solution with:
> make_forward_solution(raw.info, trans, src, bem, meg=True, eeg=False)
> Thinking that this would pick only the MEG channels.

Indeed it should. You can check with fwd['sol']['row_names'].

However, my noise covariance is calculated from epochs, not the raw data,
> and I think that creating a forward solution using raw.info and the 
> covariance using epoch.info resulted in a clash of channels, even 
> though both of them have 270 MEG channels.

It shouldn't. Creating epochs should not change the channel names. I would try making your script as short as possible to reproduce these steps and see if they fail. Something like:\

raw = mne.io.read_raw_something(...)
events = mne.make_fixed_length_events(raw) epochs = mne.Epochs(raw, events) assert raw.ch_names == epochs.ch_names cov = mne.compute_covariance(epochs) assert cov['names'] == epochs.ch_names fwd = make_forward_solution(raw.info, ...) inv = make_inverse_operator(epochs.info, fwd, noise_cov)

If the filled-out version of this fails on your data, there is probably some bug in MNE with these functions. If it works, then you can gradually add lines to it (or remove lines from your other script(s)) to figure out what step breaks things. It could be some bug in MNE or some bug in your script.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200721/2556423e/attachment-0001.html 


Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu

End of Mne_analysis Digest, Vol 150, Issue 36

More information about the Mne_analysis mailing list