[Mne_analysis] Inputting bad channels through raw.plot() while applying a CAR reference.

Scheltienne Mathieu mathieu.scheltienne at epfl.ch
Wed Dec 16 03:48:43 EST 2020
Search archives:

        External Email - Use Caution        

Hi Eric,

Thank you for the reply.
I do not apply the projectors to the data, the code is:

                # Load
raw = mne.io.read_raw_fif(fname, preload=True)
raw.set_channel_types(mapping={'ECG':'ecg', 'EOG':'eog'})
raw.set_montage('standard_1020')
raw.info['bads'] = list()

# Conversion
raw.apply_function(conversion_uVolt2Volt, picks=['ecg', 'eog', 'eeg'], dtype=None,
                                      n_jobs=1, channel_wise=True, verbose=None)
raw.apply_function(brainvisionMarkersCh2StimCh, picks=['stim'], dtype=None,
                                      n_jobs=1, channel_wise=True, verbose=None)

# Car and filters
raw.set_eeg_reference(ref_channels='average', ch_type='eeg', projection=True)
mne.io.Raw.filter(raw, l_freq=1., h_freq=100., picks=['ecg', 'eog', 'eeg'], method='iir',
                  iir_params=dict(order=4, ftype='butter', output='sos'))
raw.notch_filter(np.arange(50, 151, 50), picks=['ecg', 'eog'], filter_length='auto', phase='zero')

# Plot
raw.plot(scalings=dict(eeg=20e-6, eog=4e-2, ecg=5e-2, stim=2))

In the plot interface, the CAR projector is selected in the bottom right projector panel.
When in the plot I click on a channel to mark it as bad (changing its color to light grey), the others do not change at all, thus I don’t think the projector is updated on my setup.

Best,
Mathieu

From: <mne_analysis-bounces at nmr.mgh.harvard.edu> on behalf of Eric Larson <larson.eric.d at gmail.com>
Reply to: Discussion and support forum for the users of MNE Software <Mne_analysis at nmr.mgh.harvard.edu>
Date: Tuesday, 15 December 2020 at 18:59
To: Discussion and support forum for the users of MNE Software <Mne_analysis at nmr.mgh.harvard.edu>
Subject: Re: [Mne_analysis] Inputting bad channels through raw.plot() while applying a CAR reference. {Disarmed}


        External Email - Use Caution
When applying a CAR (as a projector), MNE removes the already set MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be raw.info<http://secure-web.cisco.com/1Z5R3lf4_Yhc3f-8tcRLDANtB_KwN4pLGbSuFpRLxU1AF4atIofcrktKaEDvZRxIf17jXo8CjVhq_M1Ag-hLXAPQorOED0O3y6sqtUKhUSxYmno8YfvJn7WWLUF_vNNv78K9vXpLNzY0EmEYTYJzvl1qljUaKQ6JzVdZATHuiVjdXfh0iLr52ifZm_FwLBPTfnU6e9v86Fe90V-JNAOCf0epQZs3lRAmJyVKKdy9LZAp21URuxEa7X2mWki9UY6nfH1En5Q7Gi1J9yUn8SrfXLg/http%3A%2F%2Fraw.info>[‘bads’] from the average. However, when adding or removing bad channels through the plot interface, I guess the CAR projector is not updated.

As long as you don't `raw.apply_proj()`, then in `raw.plot` or `mne browse_raw` the CAR projector should be updated. If it's not, there is a bug -- feel free to open one on GitHub.

Eric

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20201216/0b988c33/attachment-0001.html 


More information about the Mne_analysis mailing list