mne-qt-browser icon indicating copy to clipboard operation
mne-qt-browser copied to clipboard

Projectors applied to the Epochs plot are not applied to the ERF/ERP image

Open hoechenberger opened this issue 3 years ago • 0 comments

MWE:

# %%
import mne

sample_dir = mne.datasets.sample.data_path()
sample_fname = sample_dir / 'MEG' / 'sample' / 'sample_audvis_raw.fif'

raw = mne.io.read_raw_fif(sample_fname, preload=True)
raw.pick_types(meg='mag', ecg=True)

epochs = mne.preprocessing.create_ecg_epochs(
    raw=raw.filter(l_freq=0.1, h_freq=30)
)

ecg_proj, _ = mne.preprocessing.compute_proj_ecg(
    raw=raw,
    n_mag=1
)

epochs.add_proj(ecg_proj)
epochs.plot(n_channels=5, n_epochs=5)

I generate ERF images by right-clicking on a channel name, with and without the ECG projector active.

https://user-images.githubusercontent.com/2046265/161730344-4db6fb7c-1f26-4934-b6d7-b07b8a866b94.mov

Expected behavior would be that the generated ERF image is based on what I can see in the browser, i.e. the traces with the ECG artifact removed via the projection.

hoechenberger avatar Apr 05 '22 10:04 hoechenberger