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_epochs2mat | Exports epoched 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_convert_ctf_markers | Converts CTF marker files to FIFF event format |
| mne_mna_bids_converter | Converts between MNA project format and BIDS directory layout |
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 |
| mne_add_triggers | Adds trigger events to raw data from a text file |
| mne_change_baselines | Changes the baseline interval in evoked data files |
| mne_change_nave | Modifies the number of averages (n_ave) field in evoked data |
| mne_copy_processing_history | Copies processing history tags between FIFF files |
| mne_fix_stim14 | Reconstructs STI 014 by combining STI 001–006 |
| mne_make_derivations | Parses a text derivation file into FIFF format |
| mne_toggle_skips | Toggles skip tags in raw data 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 |
| mne_fit_sphere_to_surf | Fits a sphere to a set of surface points |
| mne_make_scalp_surfaces | Generates decimated scalp surface meshes for visualization |
| mne_transform_points | Transforms 3D points between coordinate frames |
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 |