Skip to main content

MNE-CPP Library API

MNE-CPP provides a modular set of cross-platform C++ libraries built on Qt and Eigen. All MNE-CPP applications — MNE Scan, MNE Analyze, MNE Anonymize, and the command-line tools — are built solely on these libraries, so any functionality available in an application can also be used programmatically.

The libraries are organized in layers: low-level I/O and math utilities at the bottom, domain-specific processing in the middle, and visualization at the top.

Library Overview

Core Libraries

LibraryNamespacePurpose
UtilsUTILSLIBMath routines (MNEMath), spectral analysis (FFT, CSD, PSD), spectrogram, TPS surface warping, sphere fitting, simplex solver, K-Means clustering, I/O helpers, CircularBuffer, application logger
FsFSLIBLoad and save FreeSurfer surfaces and annotations
FiffFIFFLIBRead and write FIFF (Functional Imaging File Format) files
MneMNELIBCore data structures matching MNE-C: ForwardSolution, InverseOperator, SourceEstimate, SourceSpace, BemSurface, EpochData, and more

Processing Libraries

LibraryNamespacePurpose
FwdFWDLIBForward solution computation from FreeSurfer reconstructions for MEG/EEG source localization
InverseINVERSELIBSource localization: MNE estimation, single dipole fitting, HPI coil fitting, RAP-MUSIC (with optional GPU/CUDA)
RtProcessingRTPROCESSINGLIBReal-time processing: averaging, filtering, ICP, trigger detection, SPHARA; asynchronous workers for connectivity, HPI fitting, inverse computation, and noise estimation
ConnectivityCONNECTIVITYLIBFunctional connectivity metrics (Correlation, Cross-Correlation, Coherence, Imaginary Coherence, PLV, PLI, WPLI, and variants) with network storage, graph measures, and thresholding
CommunicationCOMMUNICATIONLIBClient/command interface for communicating with mne_rt_server

Visualization Libraries

LibraryNamespacePurpose
DispDISPLIB2D plot types (bar, graph, imagesc, lineplot, spline, tfplot) and ready-to-use QWidget-based viewers with GUI controls
Disp3D (RHI)DISP3DRHILIBRHI-based 3D visualization: cortical surfaces, connectivity networks, digitizers, BEM models, source estimates, dipoles — supports Metal, Vulkan, D3D, and OpenGL backends

For in-depth guides on specific libraries, see the Connectivity and Disp3D (RHI) pages.

API Reference (Doxygen)

The full auto-generated API documentation is available at the API Reference. Use these entry points to navigate:

SectionDescription
Namespace ListAll namespaces with brief descriptions — one per library
Class ListAlphabetical list of all classes, structs, and unions
Class IndexCompact alphabetical class index for quick lookup
Class HierarchyInheritance tree showing parent-child relationships
Class MembersIndex of all documented class members
Namespace MembersAll symbols declared at namespace scope
File ListSource and header files with directory structure