Skip to main content
v2026.11,858 entries · CC-BY 4.0
LAC HealthMedical & Research SuppliesReagents, PPE & instruments — chain-of-custody documented.Fast, traceable sourcing built for regulated research environments, from bench consumables to instrumentation.Shop lac.us CodeCASRAIlac.us

MNE-Python: Electrophysiology Analysis Guide

Learn how MNE-Python processes MEG, EEG, and intracranial data with BIDS integration, sensor-space filtering, and cortical source localization.

Written and maintained by CASRAI Editorial Board

Last updated

MNE-Python is an open-source Python library designed for exploring, visualizing, and analyzing human neurophysiological recordings, including magnetoencephalography (MEG), electroencephalography (EEG), intracranial EEG (sEEG/ECoG), and functional near-infrared spectroscopy (fNIRS). Built on Python’s scientific computing stack, it provides an end-to-end analytical workflow spanning raw signal ingestion, artifact suppression, sensor-space statistics, and cortical source localization. In contemporary neuroscience research, MNE-Python establishes transparent, scriptable processing pipelines that advance rigor across diverse electrophysiological modalities.

What it is

MNE-Python is a comprehensive electrophysiology software package designed to resolve the analytical challenges of multi-channel neural recordings. Electrophysiological data are characterized by high temporal resolution, multi-channel spatial topography, and substantial environmental and biological noise. MNE-Python addresses these complexities by implementing standardized data objects that manage sensor coordinates, filter frequencies, and event-timing metadata:

  • Core data structures: The library organizes continuous recordings in Raw objects, segmented stimulus-locked epochs in Epochs objects, and signal-averaged evoked responses (event-related potentials/fields, ERPs/ERFs) in Evoked objects.
  • Advanced artifact suppression: It provides automated tools for biological noise removal, including Independent Component Analysis (ICA) for ocular and cardiac artifacts, Signal Space Projection (SSP), and Signal Space Separation (SSS / Maxwell filtering) for MEG sensor arrays.
  • Electrophysiological inverse modeling: To localize cortical generators underlying scalp recordings, MNE-Python integrates forward modeling with distributed minimum-norm estimates (dSPM, sLORETA, eLORETA), linearly constrained minimum variance (LCMV) beamformers, and equivalent current dipole (ECD) fitting.

Unlike proprietary software suites with opaque graphical routines, MNE-Python emphasizes scriptable, fully auditable analytical pipelines. Integration with the Brain Imaging Data Structure through the mne-bids extension enables research teams to structure their neuroimaging data sharing workflows into machine-readable, publication-ready formats.

Who runs it and what it covers

MNE-Python was created in 2010 by Alexandre Gramfort as a Python reimplementation of the original C-based MNE software package developed by Matti Hämäläinen at the Athinoula A. Martinos Center for Biomedical Imaging (Massachusetts General Hospital / Harvard Medical School). The canonical methodology and software architecture were published by Gramfort et al. (2013) in Frontiers in Neuroscience (doi:10.1038/fnins.2013.00267).

The project is community-governed and steered by an international Maintainer Team and Steering Council spanning leading neuroimaging laboratories, including Inria, Aalto University, the Donders Institute for Brain, Cognition and Behaviour at Radboud University, the University of Graz, and the Institute for Learning & Brain Sciences at the University of Washington. Maintenance and feature development are supported by major competitive research awards, including:

  • National Institutes of Health (NIH grant R01-NS104585).
  • US National Science Foundation (NSF grant 2449064).
  • Chan Zuckerberg Initiative Essential Open Source Software for Science (CZI EOSS2 and EOSS4 awards).
  • Past institutional support from the European Research Council (ERC grants YStG-263584 and YStG-676943) and French Agence Nationale de la Recherche (ANR).

MNE-Python covers all standard electrophysiological data modalities and vendor hardware, providing native file readers for Elekta/Neuromag/MEGIN, CTF, BTi/4D, KIT/Yokogawa, BioSemi (.bdf), BrainVision (.vhdr/.eeg), European Data Format (.edf), and EEGLAB (.set). This transparent, open-source framework directly supports adherence to the reproducibility criteria established by the NIH rigor and reproducibility policy.

How to search or use it

Researchers execute MNE-Python workflows through scriptable Python environments or Jupyter notebooks. A complete electrophysiological analysis workflow follows seven standard operational steps:

  1. Configure isolated environment: Install MNE-Python and its core scientific dependencies using conda-forge or pip within an isolated environment:
    conda create --channel=conda-forge --strict-channel-priority --name=mne mne python=3.11

    (For containerized deployments in shared cluster infrastructure, review Docker vs virtual machines).

  2. Import raw recordings: Ingest continuous electrophysiological files using modality-specific I/O functions (e.g., mne.io.read_raw_fif, mne.io.read_raw_brainvision, or mne.io.read_raw_edf). Alternatively, load validated BIDS datasets using mne_bids.read_raw_bids.
  3. Apply electrode montages and temporal filtering: Map physical sensor locations onto standardized coordinates using raw.set_montage('standard_1020'). Remove slow DC drift and high-frequency noise using zero-phase finite impulse response (FIR) filtering via raw.filter(l_freq=1.0, h_freq=40.0).
  4. Isolate and remove artifacts with ICA: Decompose sensor signals into independent components using mne.preprocessing.ICA. Identify blink and heartbeat artifacts by correlating component time series with EOG/ECG channels, inspect component topography maps, and subtract artifactual components with ica.apply(raw).
  5. Extract stimulus-locked epochs: Parse experimental trigger channels using mne.find_events(raw) and segment continuous signals into discrete trials with mne.Epochs(raw, events, event_id, tmin=-0.2, tmax=0.8, baseline=(-0.2, 0)).
  6. Compute evoked responses and time-frequency representations: Average epoched trials across experimental conditions using epochs.average() to generate Evoked objects. Compute spectral power perturbations using Morlet wavelets with mne.time_frequency.tfr_morlet.
  7. Perform cortical source localization and export: Construct head models from structural MRI segmentations (via FreeSurfer), calculate forward lead fields with mne.make_forward_solution, and apply inverse estimators using mne.minimum_norm.apply_inverse. Archive analytical scripts and derivatives according to institutional data sharing and DMP protocols.

Strengths and limits

  • Strengths:
    • Methodological versatility: Supports sensor-level analysis, time-frequency decomposition, machine learning decoding, and advanced cortical source reconstruction within a unified API.
    • Open-source and vendor-agnostic: Replaces costly proprietary software with an open, inspectable platform compatible with all major recording systems.
    • BIDS ecosystem integration: mne-bids streamlines FAIR data structuring and automated provenance tracking for public repository deposit.
    • Extensive visualization tools: Built-in 2D topographic mapping and interactive 3D cortical rendering simplify visual inspection.
  • Limits:
    • No native graphical user interface: Requires working knowledge of Python programming and shell scripting, creating an entry barrier for non-programming clinicians.
    • Memory footprint: Working with multi-channel raw files at high sampling rates (e.g., 2,000 Hz) requires substantial RAM when using preload=True.
    • Source estimation complexity: Accurate 3D source modeling requires coregistered structural MRI scans preprocessed through FreeSurfer, increasing total computational overhead.

Alternatives

Researchers evaluate MNE-Python against several mature electrophysiological software packages based on institutional infrastructure, programming familiarity, and hardware compatibility.

Software Platform Primary Language Primary Interface BIDS Integration Source Localization Licensing / Cost
MNE-Python Python Scripting & API Native (mne-bids) dSPM, sLORETA, Beamformers Open-source (BSD 3-Clause)
EEGLAB MATLAB Interactive GUI & CLI Plugin (bids-matlab-tools) DIPFIT / Loreta plugins Open-source (requires MATLAB)
FieldTrip MATLAB Scripting / Functions Supported (data2bids) DICS, LCMV, DICS beamformers Open-source (requires MATLAB)
Brainstorm MATLAB / Java Rich Interactive GUI Native BIDS import/export Integrated MNE, Min-Norm, dipole Open-source (stand-alone compiled)
SPM12 (MEG/EEG) MATLAB / C GUI & Scripting External scripting Variational Bayes / DCM Open-source (requires MATLAB)

FAQ

How does MNE-BIDS enhance reproducibility in electrophysiology?

MNE-BIDS is a companion library that programmatically organizes electrophysiology data according to the Brain Imaging Data Structure standard. It validates directory hierarchies, structures metadata sidecars into JSON and TSV files, and manages coordinate systems across MEG and EEG sensors, ensuring datasets can be ingested without custom parsing scripts.

How does an MNE-Python tutorial pipeline transition from sensor to source space?

Transitioning from sensor topography to source space requires combining electrophysiological recordings with anatomical structural MRI. Researchers coregister digitized scalp electrode locations with structural MRI fiducials, construct a boundary element model (BEM) of the head conductors, compute a forward solution lead field matrix, and apply an inverse estimator (such as dSPM or sLORETA) to estimate dynamic current dipole activity across the cortical surface mesh.

What vendor file formats can MNE-Python read natively?

MNE-Python includes native readers for Elekta/Neuromag FIF files, BioSemi BDF files, BrainVision VHDR/EEG files, European Data Format (EDF), CTF MEG datasets, EGI MFF files, and EEGLAB SET files, eliminating the need for third-party file conversion utilities.

When should researchers choose MNE-Python over EEGLAB or FieldTrip?

Researchers choose MNE-Python when building automated, reproducible data analysis pipelines integrated with modern Python machine learning libraries (such as scikit-learn and PyTorch), when operating in high-performance computing clusters without MATLAB licensing constraints, or when performing advanced source estimation that leverages FreeSurfer anatomical models.

Sources

  • Gramfort, A., Luessi, M., Larson, E., Engemann, D. A., Strohmeier, D., Brodbeck, C., Goj, R., Jas, M., Brooks, T., Parkkonen, L., & Hämäläinen, M. S. (2013). MEG and EEG data analysis with MNE-Python. Frontiers in Neuroscience, 7(267):1–13. https://doi.org/10.3389/fnins.2013.00267 (read 2026-11-08).
  • Appelhoff, S., Sanderson, M., Brooks, T., van Vliet, M., Quentin, R., Holdgraf, C., Chaumon, M., Mikulan, E., Tavabi, K., Höchenberger, R., Welke, D., Brunner, C., Rockhill, A., Larson, E., Gramfort, A., & Jas, M. (2019). MNE-BIDS: Organizing electrophysiological data into the BIDS format and facilitating their analysis. Journal of Open Source Software, 4(44), 1896. https://doi.org/10.21105/joss.01896 (read 2026-11-08).
  • MNE-Python Development Team. (2026). MNE-Python Documentation and Manual Installation Guide. Documentation hosted at https://mne.tools/stable/ (read 2026-11-08).
  • MNE-Python Development Team. (2026). MNE Project Leadership and Sponsorship. Documentation hosted at https://mne.tools/stable/credits/sponsors.html (read 2026-11-08).

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about MNE-Python: Electrophysiology Analysis Guide

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →