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:
- Data Import — Convert raw data from various acquisition systems to FIFF format.
- Preprocessing — Mark bad channels, apply compensation, filter, and compute SSP projectors.
- Head Model (BEM) — Create and validate boundary-element model surfaces.
- Source Space — Set up cortical surface or volumetric source grids.
- Forward & Inverse Computation — Compute lead fields and source estimates.
- Morphing & Group Analysis — Map results across subjects for group studies.
- Simulation & Validation — Generate synthetic data and compare files.
Data Import and Conversion
| Tool | Description |
|---|---|
| mne_edf2fiff | Converts EDF/EDF+ files to FIFF format |
| mne_brain_vision2fiff | Converts BrainVision EEG data (.vhdr) to FIFF format |
| mne_ctf2fiff | Converts CTF MEG datasets (.ds) to FIFF format |
| mne_kit2fiff | Converts KIT/Yokogawa MEG data (.sqd/.con) to FIFF format |
| mne_tufts2fiff | Converts Tufts University EEG data to FIFF format |
| mne_eximia2fiff | Converts Nexstim eXimia EEG data (.nxe) to FIFF format |
| mne_raw2mat | Exports raw FIFF data to MATLAB .mat format |
| mne_convert_surface | Converts surface meshes between FIFF, FreeSurfer, .tri, and .smf formats |
| mne_convert_dig_data | Converts digitization data between FIFF and hpts formats |
| mne_ctf_dig2fiff | Converts CTF Polhemus digitization data to FIFF/hpts format |
| mne_show_fiff | Lists the contents of a FIFF file |
| mne_compare_fif_files | Compares two FIFF files tag by tag |
Raw Data Processing and Preprocessing
| Tool | Description |
|---|---|
| mne_process_raw | Batch processing of raw data: filtering, decimation, averaging, covariance estimation, SSP, and event detection |
| mne_mark_bad_channels | Marks channels as bad in a FIFF measurement file |
| mne_rename_channels | Renames channels in a FIFF file using an alias mapping |
| mne_fix_mag_coil_types | Fixes magnetometer coil type definitions in FIFF files |
| mne_compensate_data | Applies or changes CTF software gradient compensation grade |
| mne_cov2proj | Derives SSP projection vectors from a noise covariance matrix |
| mne_anonymize | Removes or modifies personal health information from FIFF files |
BEM Model Creation and Validation
| Tool | Description |
|---|---|
| mne_watershed_bem | Creates BEM surfaces using FreeSurfer's watershed algorithm |
| mne_flash_bem | Creates BEM surfaces using multi-echo FLASH MRI sequences |
| mne_surf2bem | Converts FreeSurfer surfaces and ASCII triangle files into BEM FIFF files |
| mne_setup_forward_model | Sets up the BEM for forward modeling |
| mne_prepare_bem_model | Computes the BEM solution (geometry matrices) for the forward solver |
| mne_make_sphere_bem | Creates a spherical BEM model from concentric shells |
| mne_check_surface | Validates BEM and FreeSurfer surface meshes for topological correctness |
| mne_list_bem | Exports BEM surface data from FIFF to ASCII text |
MRI Setup
| Tool | Description |
|---|---|
| mne_setup_mri | Sets up FreeSurfer MRI data for MNE processing |
| mne_make_cor_set | Creates a FIFF MRI description file from FreeSurfer COR or mgh/mgz data |
Source Space Setup
| Tool | Description |
|---|---|
| mne_make_source_space | Creates cortical source spaces from FreeSurfer surfaces |
| mne_volume_source_space | Creates volumetric source spaces on a regular 3D grid |
| mne_add_patch_info | Adds cortical patch statistics to a source space |
| mne_list_source_space | Lists the contents of a source space file |
| mne_annot2labels | Converts FreeSurfer annotation files to individual label files |
Forward and Inverse Computation
| Tool | Description |
|---|---|
| mne_forward_solution | Computes the MEG/EEG forward solution |
| mne_average_forward_solutions | Computes a weighted average of multiple forward solutions |
| mne_sensitivity_map | Computes a sensitivity map from a forward solution |
| mne_inverse_operator | Assembles a linear inverse operator from a forward solution and noise covariance |
| mne_compute_mne | Computes MNE/dSPM/sLORETA source estimates from evoked data |
| mne_compute_raw_inverse | Computes inverse solutions (MNE/dSPM/sLORETA) on continuous data |
| mne_dipole_fit | Performs electric current dipole fitting |
| mne_volume_data2mri | Maps volume source estimates to MRI voxel space |
Morphing and Group Analysis
| Tool | Description |
|---|---|
| mne_make_morph_maps | Precomputes surface morphing maps between FreeSurfer subjects |
| mne_morph_labels | Morphs cortical label files between subjects |
| mne_smooth | Applies spatial smoothing to cortical source estimates |
Utilities
| Tool | Description |
|---|---|
| mne_add_to_meas_info | Adds tags from one FIFF file to the measurement info of another |
| mne_collect_transforms | Collects coordinate transforms from FIFF files |
| mne_create_comp_data | Creates CTF compensation data from ASCII matrix files |
| mne_insert_4D_comp | Merges 4D Neuroimaging reference channel compensation data with FIFF |
| mne_make_eeg_layout | Creates 2D topographical EEG layout from electrode positions |
Simulation
| Tool | Description |
|---|---|
| mne_simu | Generates simulated MEG/EEG data from a forward solution |
Real-Time Streaming
| Tool | Description |
|---|---|
| mne_rt_server | Real-time FIFF data streaming server |