Skip to main content

Command-Line Tools Reference

MNE-CPP includes a comprehensive set of command-line tools for MEG/EEG data processing, BEM model creation, forward solution computation, and inverse estimation. These tools are C++ ports of the original MNE-C tools created by Matti Hämäläinen.

Typical Processing Pipeline

The tools below are organized by their role in a typical MEG/EEG analysis workflow:

  1. Data Import — Convert raw data from various acquisition systems to FIFF format.
  2. Preprocessing — Mark bad channels, apply compensation, filter, and compute SSP projectors.
  3. Head Model (BEM) — Create and validate boundary-element model surfaces.
  4. Source Space — Set up cortical surface or volumetric source grids.
  5. Forward & Inverse Computation — Compute lead fields and source estimates.
  6. Morphing & Group Analysis — Map results across subjects for group studies.
  7. Simulation & Validation — Generate synthetic data and compare files.

Data Import and Conversion

ToolDescription
mne_edf2fiffConverts EDF/EDF+ files to FIFF format
mne_brain_vision2fiffConverts BrainVision EEG data (.vhdr) to FIFF format
mne_ctf2fiffConverts CTF MEG datasets (.ds) to FIFF format
mne_kit2fiffConverts KIT/Yokogawa MEG data (.sqd/.con) to FIFF format
mne_tufts2fiffConverts Tufts University EEG data to FIFF format
mne_eximia2fiffConverts Nexstim eXimia EEG data (.nxe) to FIFF format
mne_raw2matExports raw FIFF data to MATLAB .mat format
mne_convert_surfaceConverts surface meshes between FIFF, FreeSurfer, .tri, and .smf formats
mne_convert_dig_dataConverts digitization data between FIFF and hpts formats
mne_ctf_dig2fiffConverts CTF Polhemus digitization data to FIFF/hpts format
mne_show_fiffLists the contents of a FIFF file
mne_compare_fif_filesCompares two FIFF files tag by tag

Raw Data Processing and Preprocessing

ToolDescription
mne_process_rawBatch processing of raw data: filtering, decimation, averaging, covariance estimation, SSP, and event detection
mne_mark_bad_channelsMarks channels as bad in a FIFF measurement file
mne_rename_channelsRenames channels in a FIFF file using an alias mapping
mne_fix_mag_coil_typesFixes magnetometer coil type definitions in FIFF files
mne_compensate_dataApplies or changes CTF software gradient compensation grade
mne_cov2projDerives SSP projection vectors from a noise covariance matrix
mne_anonymizeRemoves or modifies personal health information from FIFF files

BEM Model Creation and Validation

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 and ASCII triangle files into BEM FIFF files
mne_setup_forward_modelSets up the BEM for forward modeling
mne_prepare_bem_modelComputes the BEM solution (geometry matrices) for the forward solver
mne_make_sphere_bemCreates a spherical BEM model from concentric shells
mne_check_surfaceValidates BEM and FreeSurfer surface meshes for topological correctness
mne_list_bemExports BEM surface data from FIFF to ASCII text

MRI Setup

ToolDescription
mne_setup_mriSets up FreeSurfer MRI data for MNE processing
mne_make_cor_setCreates a FIFF MRI description file from FreeSurfer COR or mgh/mgz data

Source Space Setup

ToolDescription
mne_make_source_spaceCreates cortical source spaces from FreeSurfer surfaces
mne_volume_source_spaceCreates volumetric source spaces on a regular 3D grid
mne_add_patch_infoAdds cortical patch statistics to a source space
mne_list_source_spaceLists the contents of a source space file
mne_annot2labelsConverts FreeSurfer annotation files to individual label files

Forward and Inverse Computation

ToolDescription
mne_forward_solutionComputes the MEG/EEG forward solution
mne_average_forward_solutionsComputes a weighted average of multiple forward solutions
mne_sensitivity_mapComputes a sensitivity map from a forward solution
mne_inverse_operatorAssembles a linear inverse operator from a forward solution and noise covariance
mne_compute_mneComputes MNE/dSPM/sLORETA source estimates from evoked data
mne_compute_raw_inverseComputes inverse solutions (MNE/dSPM/sLORETA) on continuous data
mne_dipole_fitPerforms electric current dipole fitting
mne_volume_data2mriMaps volume source estimates to MRI voxel space

Morphing and Group Analysis

ToolDescription
mne_make_morph_mapsPrecomputes surface morphing maps between FreeSurfer subjects
mne_morph_labelsMorphs cortical label files between subjects
mne_smoothApplies spatial smoothing to cortical source estimates

Utilities

ToolDescription
mne_add_to_meas_infoAdds tags from one FIFF file to the measurement info of another
mne_collect_transformsCollects coordinate transforms from FIFF files
mne_create_comp_dataCreates CTF compensation data from ASCII matrix files
mne_insert_4D_compMerges 4D Neuroimaging reference channel compensation data with FIFF
mne_make_eeg_layoutCreates 2D topographical EEG layout from electrode positions

Simulation

ToolDescription
mne_simuGenerates simulated MEG/EEG data from a forward solution

Real-Time Streaming

ToolDescription
mne_rt_serverReal-time FIFF data streaming server