Note
Go to the end to download the full example code.
Compare the different ICA algorithms in MNE#
Different ICA algorithms are fit to raw MEG data, and the corresponding maps are displayed.
# Authors: Pierre Ablin <pierreablin@gmail.com>
#
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.
Read and preprocess the data. Preprocessing consists of:
MEG channel selection
1-30 Hz band-pass filter
data_path = sample.data_path()
meg_path = data_path / "MEG" / "sample"
raw_fname = meg_path / "sample_audvis_filt-0-40_raw.fif"
raw = mne.io.read_raw_fif(raw_fname).crop(0, 60).pick("meg").load_data()
reject = dict(mag=5e-12, grad=4000e-13)
raw.filter(1, 30, fir_design="firwin")
Define a function that runs ICA on the raw MEG data and plots the components
FastICA
run_ica("fastica")
Picard
run_ica("picard")
Infomax
run_ica("infomax")
Extended Infomax
run_ica("infomax", fit_params=dict(extended=True))
Estimated memory usage: 0 MB