MEG and EEG data analysis with MNE-Python
Alexandre Gramfort, Martin Luessi, Eric Larson, Denis A Engemann, Daniel Strohmeier, Christian Brodbeck, Roman Goj, Mainak Jas, Teon Brooks, Lauri Parkkonen, Matti Hämäläinen, Alexandre Gramfort, Martin Luessi, Eric Larson, Denis A Engemann, Daniel Strohmeier, Christian Brodbeck, Roman Goj, Mainak Jas, Teon Brooks, Lauri Parkkonen, Matti Hämäläinen
Abstract
Magnetoencephalography and electroencephalography (M/EEG) measure the weak electromagnetic signals generated by neuronal activity in the brain. Using these signals to characterize and locate neural activation in the brain is a challenge that requires expertise in physics, signal processing, statistics, and numerical methods. As part of the MNE software suite, MNE-Python is an open-source software package that addresses this challenge by providing state-of-the-art algorithms implemented in Python that cover multiple methods of data preprocessing, source localization, statistical analysis, and estimation of functional connectivity between distributed brain regions. All algorithms and utility functions are implemented in a consistent manner with well-documented interfaces, enabling users to create M/EEG data analysis pipelines by writing Python scripts. Moreover, MNE-Python is tightly integrated with the core Python libraries for scientific comptutation (NumPy, SciPy) and visualization (matplotlib and Mayavi), as well as the greater neuroimaging ecosystem in Python via the Nibabel package. The code is provided under the new BSD license allowing code reuse, even in commercial products. Although MNE-Python has only been under heavy development for a couple of years, it has rapidly evolved with expanded analysis capabilities and pedagogical tutorials because multiple labs have collaborated during code development to help share best practices. MNE-Python also gives easy access to preprocessed datasets, helping users to get started quickly and facilitating reproducibility of methods by other researchers. Full documentation, including dozens of examples, is available at http://martinos.org/mne.
Keywords: electroencephalography (EEG); magnetoencephalography (MEG); neuroimaging; open-source; python; software.
Figures










References
- Aine C., Sanfratello L., Ranken D., Best E., MacArthur J., Wallace T., et al. (2012). MEG-SIM: a web portal for testing MEG analysis methods using realistic simulated and empirical data. Neuroinformatics 10, 141–158 10.1007/s12021-011-9132-z
- Becker R. A., Cleveland W. S., Shyu M.-J., Kaluzny S. P. (1996). A Tour of Trellis Graphics. Technical Report, Bell Laboratories
- Benjamini Y., Hochberg Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. J. R. Stat. Soc. Ser. B 57, 289–300 10.1016/j.neuroimage.2012.07.004
- Buitinck L., Louppe G., Blondel M., Pedregosa F., Mueller A., Grisel O., et al. (2013). API design for machine learning software: experiences from the scikit-learn project. in European Conference on Machine Learning and Principles and Practices of Knowledge Discovery in Databases, Prague
- Carp J. (2012a). On the plurality of (methodological) worlds: estimating the analytic flexibility of fMRI experiments. Front. Neurosci. 6:149 10.3389/fnins.2012.00149
- Carp J. (2012b). The secret lives of experiments: methods reporting in the fMRI literature. Neuroimage 63, 289–300 10.1016/j.neuroimage.2012.07.004
- Dalal S. S., Zumer J. M., Guggisberg A. G., Trumpis M., Wong D. D. E., Sekihara K., et al. (2011). MEG/EEG source reconstruction, statistical evaluation, and visualization with NUTMEG. Comput. Intell. Neurosci. 2011:758973 10.1155/2011/758973
- Dale A., Fischl B., Sereno M. (1999). Cortical surface-based analysis i: segmentation and surface reconstruction. Neuroimage 9, 179–194 10.1006/nimg.1998.0395
- Dale A., Liu A., Fischl B., Buckner R. (2000). Dynamic statistical parametric mapping: combining fMRI and MEG for high-resolution imaging of cortical activity. Neuron 26, 55–67 10.1016/S0896-6273(00)81138-1
- Delorme A., Makeig S. (2004). EEGLAB: an open source toolbox for analysis of single-trial EEG dynamics including independent component analysis. J. Neurosci. Methods 134, 9–21 10.1016/j.jneumeth.2003.10.009
- Delorme A., Mullen T., Kothe C., Acar Z. A., Bigdely-Shamlo N., Vankov A., et al. (2011). EEGLAB, SIFT, NFT, BCILAB, and ERICA: new tools for advanced EEG processing. Intell. Neurosci. 2011:130714 10.1155/2011/130714
- Desikan R. S., Ségonne F., Fischl B., Quinn B. T., Dickerson B. C., Blacker D., et al. (2006). An automated labeling system for subdividing the human cerebral cortex on MRI scans into gyral based regions of interest. Neuroimage 31, 968–980 10.1016/j.neuroimage.2006.01.021
- Destrieux C., Fischl B., Dale A., Halgren E. (2010). Automatic parcellation of human cortical gyri and sulci using standard anatomical nomenclature. Neuroimage 53:1 10.1016/j.neuroimage.2010.06.010
- Dubois P. (2005). Maintaining correctness in scientific programs. Comput. Sci. Eng. 7, 80–85 10.1109/MCSE.2005.54
- Fischl B., Sereno M., Dale A. (1999). Cortical surface-based analysis ii: inflation, flattening, and a surface-based coordinate system. Neuroimage 9, 195–207 10.1006/nimg.1998.0396
- Fischl B., Van Der Kouwe A., Destrieux C., Halgren E., Ségonne F., Salat D. H., et al. (2004). Automatically parcellating the human cerebral cortex. Cereb. Cortex 14, 11–22 10.1093/cercor/bhg087
- Fries P. (2009). Neuronal gamma-band synchronization as a fundamental process in cortical computation. Annu. Rev. Neurosci. 32, 209–224 10.1146/annurev.neuro.051508.135603
- Gorgolewski K., Burns C. D., Madison C., Clark D., Halchenko Y. O., Waskom M. L., et al. (2011). Nipype: a flexible, lightweight and extensible neuroimaging data processing framework in python. Front. Neuroinform. 5:13 10.3389/fninf.2011.00013
- Gramfort A., Keriven R., Clerc M. (2010a). Graph-based variability estimation in single-trial event-related neural responses. IEEE Trans. Biomed. Eng. 57, 1051–1061 10.1109/TBME.2009.2037139
- Gramfort A., Papadopoulo T., Olivi E., Clerc M. (2010b). OpenMEEG: opensource software for quasistatic bioelectromagnetics. BioMed Eng. OnLine 9:45 10.1186/1475-925X-9-45
- Gramfort A., Kowalski M., Hämäläinen M. (2012). Mixed-norm estimates for the M/EEG inverse problem using accelerated gradient methods. Phys. Med. Biol. 57, 1937–1961 10.1088/0031-9155/57/7/1937
- Gramfort A., Luessi M., Larson E., Engemann D., Strohmeier D., Brodbeck C., et al. (2013a). MNE software for processing MEG and EEG data. Neuroimage (in press). 10.1016/j.neuroimage.2013.10.027 Available online at:
- Gramfort A., Strohmeier D., Haueisen J., Hämäläinen M., Kowalski M. (2013b). Time-frequency mixed-norm estimates: sparse M/EEG imaging with non-stationary source activations. Neuroimage 70, 410–422 10.1016/j.neuroimage.2012.12.051
- Gramfort A., Strohmeier D., Haueisen J., Hämäläinen M., Kowalski M. (2011). Functional brain imaging with M/EEG using structured sparsity in time-frequency dictionaries, in Information Processing in Medical Imaging, Vol. 6801 of Lecture Notes in Computer Science, eds Székely G., Hahn H. (Heidelberg; Berlin: Springer; ), 600–611
- Granger C. W. J., Hatanaka M. (1964). Spectral Analysis of Economic Time Series. Princeton, NJ: Princeton University Press
- Gross J., Baillet S., Barnes G., Henson R., Hillebrand A., Jensen O., et al. (2013). Good practice for conducting and reporting MEG research. Neuroimage 65, 349–363 10.1016/j.neuroimage.2012.10.001
- Gross J., Kujala J., Hamalainen M., Timmermann L., Schnitzler A., Salmelin R. (2001). Dynamic imaging of coherent sources: Studying neural interactions in the human brain. Proc. Natl. Acad. Sci. U.S.A. 98, 694–699 10.1073/pnas.98.2.694
- Hämäläinen M., Hari R., Ilmoniemi R., Knuutila J., Lounasmaa O. (1993). Magnetoencephalography - Theory, instrumentation, and applications to noninvasive studies of the working human brain. Rev. Modern Phys. 65, 413–497 10.1103/RevModPhys.65.413
- Hämäläinen M., Ilmoniemi R. (1994). Interpreting magnetic fields of the brain: minimum norm estimates. Med. Biol. Eng. Comput. 32, 35–42 10.1007/BF02512476
- Hunter J. D. (2007). Matplotlib: a 2d graphics environment. Comput. Sci. Eng. 9, 90–95 10.1109/MCSE.2007.55
- Hyvärinen A., Oja E. (2000). Independent component analysis: algorithms and applications. Neural networks 13, 411–430 10.1016/S0893-6080(00)00026-5
- Klöckner A., Pinto N., Lee Y., Catanzaro B., Ivanov P., Fasih A. (2012). PyCUDA and PyOpenCL: a scripting-based approach to GPU run-time code generation. Parallel Comput. 38, 157–174 10.1016/j.parco.2011.09.001
- Lachaux J.-P., Rodriguez E., Martinerie J., Varela F. J. (1999). Measuring phase synchrony in brain signals. Hum. Brain Mapp. 8, 194–208 10.1002/(SICI)1097-0193(1999)8:4<194::AID-HBM4>;2-C
- Larson E., Lee A. K. C. (2013). The cortical dynamics underlying effective switching of auditory spatial attention. Neuroimage 64, 365–370 10.1016/j.neuroimage.2012.09.006
- Litvak V., Mattout J., Kiebel S., Phillips C., Henson R., Kilner J., et al. (2011). EEG and MEG data analysis in SPM8. Comput. Intell. Neurosci. 2011:852961 10.1155/2011/852961
- Maris E., Oostenveld R. (2007). Nonparametric statistical testing of EEG- and MEG-data. J. Neurosci. Methods 164, 177–190 10.1016/j.jneumeth.2007.03.024
- Nichols T. E., Holmes A. P. (2002). Nonparametric permutation tests for functional neuroimaging: a primer with examples. Hum. Brain Mapp. 15, 1–25 10.1002/hbm.1058
- Nolte G., Bai O., Wheaton L., Mari Z., Vorbach S., Hallett M. (2004). Identifying true brain interaction from eeg data using the imaginary part of coherency. Clin. Neurophysiol. 115, 2292–2307 10.1016/j.clinph.2004.04.029
- Oostenveld R., Fries P., Maris E., Schoffelen J.-M. (2011). Field Trip: open source software for advanced analysis of MEG, EEG, and invasive electrophysiological data. Comput. Intell. Neurosci. 2011:156869 10.1155/2011/156869
- Pantazis D., Nichols T. E., Baillet S., Leahy R. M. (2005). A comparison of random field theory and permutation methods for the statistical analysis of MEG data. Neuroimage 25, 383–394 10.1016/j.neuroimage.2004.09.040
- Pascual-Marqui R. (2002). Standardized low resolution brain electromagnetic tomography (sLORETA): technical details. Methods Find. Exp. Clin. Pharmacology 24, 5–12 Available online at:
- Pedregosa F., Varoquaux G., Gramfort A., Michel V., Thirion B., Grisel O., et al. (2011). Scikit-learn: machine learning in Python. J. Mach. Learn. Res. 12, 2825–2830 Available online at:
- Ramachandran P., Varoquaux G. (2010). Mayavi: a package for 3d visualization of scientific data. Comput. Sci. Eng. 13, 40–51 10.1109/MCSE.2011.35
- Ridgway G. R., Litvak V., Flandin G., Friston K. J., Penny W. D. (2012). The problem of low variance voxels in statistical parametric mapping; a new hat avoids a “haircut.” Neuroimage 59, 2131–2141 10.1016/j.neuroimage.2011.10.027
- Schelter B., Winterhalder M., Timmer J. (2006). Handbook of Time Series Analysis. Weinheim: Wiley-VCH
- Scherg M., Von Cramon D. (1985). Two bilateral sources of the late AEP as identified by a spatio-temporal dipole model. Electroencephalogr. Clin. Neurophysiol. 62, 32–44 10.1016/0168-5597(85)90033-4
- Schoffelen J.-M., Gross J. (2009). Source connectivity analysis with MEG and EEG. Hum. Brain Mapp. 30, 1857–1865 10.1002/hbm.20745
- Tadel F., Baillet S., Mosher J. C., Pantazis D., Leahy R. M. (2011). Brainstorm: a user-friendly application for MEG/EEG analysis. Comput. Intell. Neurosci. 2011:879716 10.1155/2011/879716
- Tallon-Baudry C., Bertrand O., Wienbruch C., Ross B., Pantev C. (1997). Combined EEG and MEG recordings of visual 40 hz responses to illusory triangles in human. Neuroreport NA, 1103–1107 10.1097/00001756-199703240-00008
- Uusitalo M., Ilmoniemi R. (1997). Signal-space projection method for separating MEG or EEG into components. Med. Biol. Eng. Comput. 35, 135–140 10.1007/BF02534144
- Van der Walt S., Colbert S., Varoquaux G. (2011). The NumPy array: a structure for efficient numerical computation. Comp. Sci. Eng. 13, 22–30 10.1109/MCSE.2011.37
- Van Essen D., Ugurbil K., Auerbach E., Barch D., Behrens T., Bucholz R., et al. (2012). The human connectome project: A data acquisition perspective. Neuroimage 62, 2222–2231 10.1016/j.neuroimage.2012.02.018
- Van Veen B., van Drongelen W., Yuchtman M., Suzuki A. (1997). Localization of brain electrical activity via linearly constrained minimum variance spatial filtering. IEEE Trans. Biomed. Eng. 44, 867–880 10.1109/10.623056
- Wang J.-Z., Williamson S. J., Kaufman L. (1992). Magnetic source images determined by a lead-field analysis: the unique minimum-norm least-squares estimation. IEEE Trans. Biomed. Eng. 39, 665–675 10.1109/10.142641
- Wipf D., Nagarajan S. (2009). A unified Bayesian framework for MEG/EEG source imaging. Neuroimage 44, 947–966 10.1016/j.neuroimage.2008.02.059
- Wolters C. H., Köstler H., Möller C., Härdtlein J., Grasedyck L., Hackbusch W. (2007). Numerical mathematics of the subtraction method for the modeling of a current dipole in EEG source reconstruction using finite element head models. SIAM J. Sci. Comput. 30, 24–45 10.1137/060659053
Source: PubMed
Upcoming Clinical Trials
-
Pelage Pharmaceuticals, Inc.Not yet recruitingAndrogenetic Alopecia
-
Manahil GillRecruiting
-
IBSA Institut Biochimique SANot yet recruiting
-
M.D. Anderson Cancer CenterImaginAb, Inc.Not yet recruitingAdvanced Melanoma | Tumor Infiltrating Lymphocyte | CD8-PETUnited States
-
Johns Hopkins UniversityNot yet recruiting
-
Karolinska InstitutetRegion StockholmNot yet recruitingIntoxication | Delirium Tremens (DTs) | Poisoning by Psychoactive Substances | Suicidal Attempt
-
M.D. Anderson Cancer CenterNot yet recruitingApple Vision Pro | Image Guided Procedure | Spatial ComputingUnited States
-
Osaka UniversityRecruitingAcute Ichemic Stroke | Active CancerJapan
-
Polytechnic Institute of PortoUniversity of Coimbra; OPTIMIZER - Serviços e Consultadoria Informática, Lda.; LINOVT - Engenharia Software, Lda...RecruitingAmblyopia | Anisometropic AmblyopiaPortugal
-
Sam Houston State UniversityNational Pork BoardRecruitingStress | Cognition | Muscle Damage | Exercise Recovery | Blood Biomarkers | Physical Performance ParametersUnited States
-
Shaodong HongShanghai Junshi Bioscience Co., Ltd.; Sichuan Kelun-Biotech Biopharmaceutical...Not yet recruitingNon-Small Cell Lung Cancer
-
Shaodong HongShanghai Yizhong Pharmaceutical Co., Ltd.; AkesobioNot yet recruitingSCLC, RecurrentChina