This Brainlife App applies Independent Component Analysis (ICA) decomposition to epoched MEG/EEG data using MNE-Python's ICA.apply(). The app reads an ICA object, excludes identified bad components (automatically detected for EOG/ECG artifacts or manually specified), and reconstructs the epoched data before saving it.
The app generates:
- Epoched data with the ICA components applied (
meg-epo.fif) - An overlay visualization comparing the epoched data before and after ICA application
- An HTML QC report with the ICA decomposition and excluded-component details
- A
product.jsonsummarizing the excluded components
epo(neuro/meeg/mne/epochs): epoched MEG/EEG data to apply ICA to (required)ica(neuro/meeg/mne/ica): fitted ICA decomposition object, e.g. fromICA-fit(required)
out_dir/meg-epo.fif(neuro/meeg/mne/epochs): epoched data with the ICA components appliedout_figs/plot_overlay.png(generic/image/png): visualization of the ICA overlay before applicationout_report/report.html(report/html): quality control report with ICA informationproduct.json: metadata about the applied ICA for the Brainlife.io interface
| key | type | default | description |
|---|---|---|---|
exclude |
string | "" |
Comma-separated list of component indices to exclude, in addition to any already in ica.exclude. The union of the two is excluded. |
reject_EOG |
boolean | false |
Whether to automatically detect and exclude EOG artifact components using mne.preprocessing.ICA.find_bads_eog. |
EOG_chan |
string | "" |
EOG channel name or index for automatic EOG detection (optional). |
reject_ECG |
boolean | false |
Whether to automatically detect and exclude ECG artifact components using mne.preprocessing.ICA.find_bads_ecg. |
ECG_chan |
string | "" |
ECG channel name or index for automatic ECG detection (optional). |
- Select your epoched MEG/EEG
.fifdataset as theepoinput and the fitted ICA decomposition (e.g. fromICA-fit) as theicainput. - Optionally set
excludeto a comma-separated list of additional component indices to exclude. - Optionally enable
reject_EOG/reject_ECGto automatically detect and exclude EOG/ECG artifact components, specifyingEOG_chan/ECG_chanif needed. - Submit the process.
# Edit config.json to point "epo" and "ica" at real files, then:
python main.pyThe app uses MNE-Python's ICA functionality to apply component exclusion to epoched data. It supports:
- Manual component exclusion via index specification
- Automatic EOG artifact detection using correlation analysis
- Automatic ECG artifact detection using cross-trial phase statistics
- Quality control visualization and reporting
- Saeed Zahran (https://github.com/saeedzahranutc)
- Maximilien Chaumon (https://github.com/dnacombo)
We kindly ask that you cite the following articles when publishing papers and code using this app:
Hayashi, S., Caron, B.A., Heinsfeld, A.S. et al. brainlife.io: a decentralized and open-source cloud platform to support neuroscience research. Nat Methods 21, 809–813 (2024). https://doi.org/10.1038/s41592-024-02237-2
Gramfort A, Luessi M, Larson E, Engemann DA, Strohmeier D, Brodbeck C, Goj R, Jas M, Brooks T, Parkkonen L, and Hämäläinen MS. MEG and EEG data analysis with MNE-Python. Frontiers in Neuroscience, 7(267):1–13, 2013. https://doi.org/10.3389/fnins.2013.00267
brainlife.io is publicly funded and for the sustainability of the project it is helpful to Acknowledge the use of the platform. We kindly ask that you acknowledge the funding below in your publications and code reusing this code.
Copyright (c) 2026 MEEG Brainlife team. Licensed under AGPL-3.0, see license.txt.