Skip to main content

MNE-CPP Manual

Overview

MNE-CPP provides a comprehensive set of tools for preprocessing and averaging of MEG and EEG data and for constructing cortically-constrained minimum-norm estimates. The software is based on anatomical MRI processing, forward modelling, and source estimation methods. The anatomical MRI processing routines depend on tools provided by the FreeSurfer software.

This manual gives an overview of the software modules included with MNE-CPP, describes a typical workflow for a novice user, and provides detailed information about the individual software modules.

Heritage

MNE-CPP is a C++ port of the original MNE software suite created by Matti Hämäläinen at the Martinos Center for Biomedical Imaging. This manual is adapted from the original MNE Manual and the MNE-Python documentation, preserving the valuable background information and mathematical descriptions while documenting the C++ implementations available in MNE-CPP.

Software Components

The MNE-CPP software suite includes the following main components:

GUI Applications

ApplicationDescription
mne_scanReal-time acquisition and processing of MEG/EEG data with plugin-based architecture
mne_analyzeSensor- and source-level analysis of pre-recorded MEG/EEG data (under development)
mne_inspect3D brain visualization and source analysis
mne_browseBrowsing and visualization of raw MEG/EEG FIFF data files (under development)

Command-Line Tools

See the Command-Line Tools Overview for full details. The tools are organized by domain:

Forward Modeling

ToolDescription
mne_watershed_bemCreates BEM surfaces using FreeSurfer's watershed algorithm
mne_flash_bemCreates BEM surfaces using multi-echo FLASH MRI sequences
mne_surf2bemConverts FreeSurfer surfaces to BEM FIFF files
mne_setup_forward_modelSets up the BEM for forward modeling
mne_setup_mriSets up FreeSurfer MRI data for MNE processing
mne_forward_solutionComputes the MEG/EEG forward solution
mne_make_source_spaceCreates a source space for forward/inverse computations
mne_make_sphere_bemCreates a spherically symmetric BEM model
mne_prepare_bem_modelPrepares a BEM model for forward computation
mne_average_forward_solutionsAverages forward solutions
mne_check_surfaceChecks BEM surface integrity

Inverse

ToolDescription
mne_inverse_operatorAssembles the inverse operator
mne_compute_mneComputes MNE/dSPM/sLORETA from evoked data
mne_compute_raw_inverseComputes inverse solutions from raw or evoked data
mne_dipole_fitPerforms electric current dipole fitting
mne_sensitivity_mapComputes sensitivity maps for MEG/EEG
mne_smoothSmooths source estimates on the cortical surface
mne_volume_data2mriConverts volumetric source estimates to MRI coordinates

Preprocessing

ToolDescription
mne_anonymizeRemoves or modifies personal health information from FIFF files
mne_process_rawFilters, averages, and processes raw MEG/EEG data
mne_mark_bad_channelsMarks bad channels in a FIFF file
mne_compensate_dataApplies or removes software gradient compensation
mne_cov2projConverts a noise covariance matrix to a projection operator
mne_add_to_meas_infoAdds information to a FIFF measurement file
mne_create_comp_dataCreates compensation data for CTF systems
mne_fix_mag_coil_typesFixes magnetometer coil type entries
mne_insert_4D_compInserts 4D compensation data into a FIFF file
mne_rename_channelsRenames channels in a FIFF file

Conversion

ToolDescription
mne_edf2fiffConverts EDF (European Data Format) files to FIFF
mne_brain_vision2fiffConverts Brain Vision files to FIFF
mne_ctf2fiffConverts CTF data to FIFF
mne_ctf_dig2fiffConverts CTF digitization data to FIFF
mne_kit2fiffConverts KIT/Yokogawa data to FIFF
mne_raw2matConverts raw FIFF data to MATLAB format
mne_eximia2fiffConverts Nexstim eXimia data to FIFF
mne_tufts2fiffConverts Tufts University data to FIFF
mne_convert_dig_dataConverts digitizer data between formats
mne_convert_surfaceConverts surface files between formats
mne_make_cor_setCreates a set of COR files from MRI data

Surface

ToolDescription
mne_annot2labelsConverts FreeSurfer annotation files to label files
mne_add_patch_infoAdds patch information to a source space
mne_volume_source_spaceCreates a volumetric source space
mne_morph_labelsMorphs label files between subjects
mne_make_morph_mapsCreates morphing maps between subjects
mne_make_eeg_layoutCreates EEG channel layout files

Info

ToolDescription
mne_show_fiffLists the contents of a FIFF file
mne_list_source_spaceLists source space information
mne_compare_fif_filesCompares two FIFF files
mne_collect_transformsCollects coordinate transforms from a FIFF file
mne_list_bemLists BEM surface information

Server & Simulation

ToolDescription
mne_rt_serverReal-time FIFF data streaming server
mne_simuSimulates MEG/EEG data

Prerequisites

To make full use of the MNE-CPP software, you will need:

  • FreeSurfer: Required for anatomical MRI processing, cortical surface reconstruction, and the creation of BEM meshes. Available at https://surfer.nmr.mgh.harvard.edu/.

  • MEG/EEG Data: Data in FIFF format (the native format of Neuromag/Elekta/MEGIN MEG systems). Data from other systems can be converted using appropriate tools (e.g., mne_edf2fiff for EDF data).

  • Environment Variables: Several MNE-CPP tools rely on the following environment variables:

    • SUBJECTS_DIR — The directory containing FreeSurfer subject reconstructions
    • SUBJECT — The name of the current subject
    • FREESURFER_HOME — The FreeSurfer installation directory

Chapter Overview

Acknowledgments

The development of the MNE software has been supported by the National Center for Research Resources (NCRR), the NIH (grants R01EB009048, R01EB006385, R01HD40712), and the U.S. Department of Energy. We are grateful to the MNE software users at the Martinos Center and other institutions for their collaboration and valuable feedback on the software and its documentation.