Interpolate bad channels for MEG/EEG channels¶
This example shows how to interpolate bad MEG/EEG channels
Using spherical splines from 1 for EEG data.
Using field interpolation for MEG and EEG data.
In this example, the bad channels will still be marked as bad. Only the data in those channels is replaced.
# Authors: Denis A. Engemann <firstname.lastname@example.org> # Mainak Jas <email@example.com> # # License: BSD-3-Clause
Reading /home/circleci/mne_data/MNE-sample-data/MEG/sample/sample_audvis-ave.fif ... Read a total of 4 projection items: PCA-v1 (1 x 102) active PCA-v2 (1 x 102) active PCA-v3 (1 x 102) active Average EEG reference (1 x 60) active Found the data of interest: t = -199.80 ... 499.49 ms (Left Auditory) 0 CTF compensation matrices available nave = 55 - aspect type = 100 Projections have already been applied. Setting proj attribute to True. Applying baseline correction (mode: mean)
Compute interpolation (also works with Raw and Epochs objects)
Interpolating bad channels Automatic origin fit: head of radius 91.0 mm Computing interpolation matrix from 59 sensor positions Interpolating 1 sensors Computing dot products for 305 MEG channels... Computing cross products for 305 → 1 MEG channel... Preparing the mapping matrix... Truncating at 85/305 components to omit less than 0.0001 (9.4e-05)
You can also use minimum-norm for EEG as well as MEG
Interpolating bad channels Automatic origin fit: head of radius 91.0 mm Computing dot products for 305 MEG channels... Computing cross products for 305 → 1 MEG channel... Preparing the mapping matrix... Truncating at 85/305 components to omit less than 0.0001 (9.4e-05) Computing dot products for 59 EEG channels... Computing cross products for 59 → 60 EEG channels... Preparing the mapping matrix... Truncating at 58/59 components and regularizing with α=1.0e-01 The map has an average electrode reference (60 channels)
François M. Perrin, Jacques Pernier, Olivier M. Bertrand, and Jean Franćois Echallier. Spherical splines for scalp potential and current density mapping. Electroencephalography and Clinical Neurophysiology, 72(2):184–187, 1989. doi:10.1016/0013-4694(89)90180-6.
Total running time of the script: ( 0 minutes 18.295 seconds)
Estimated memory usage: 79 MB