MNE-CPP API Reference
This section is the canonical reference for every public class in the MNE-CPP C++ libraries. It is generated automatically from the in-source Doxygen comments and a curated registry of public symbols, so the view you see here always matches the headers that ship with the build.
The registry lives at
doc/api_registry.json
and the generator is implemented in
scripts/doxy2mdx/doxy2mdx.py.
How to use this reference
- Pick a library from the sidebar on the left. Each entry expands into the public classes and header-level modules it ships. The sidebar labels are human-readable ("IO Library", "Core Library", "Forward Library", …); the C++ namespace they map to is listed in the table below.
- Class pages start with a banner that names the C++ namespace, the library the class belongs to, and the header it ships in. Below that the page lists the public Signals, Public Slots, Public Methods and Static Methods with full Doxygen-derived signatures, parameter descriptions and KaTeX-rendered math. The right-hand table of contents lets you jump between members.
- Module pages document headers that contain free functions
instead of a C++ class (for example
Sphara,PeakFinder,InvConvenience). - Pages that have a worked example in
src/examples/surface it inline in a dedicated Example section so you have a runnable starting point.
Libraries and namespaces
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 organised in layers: low-level I/O and math at the bottom, domain-specific processing in the middle, and visualization at the top.
Core Libraries
| Library | Namespace | Purpose |
|---|---|---|
| Base | mne | Foundation of every library: logging, error results, byte streams, string and path helpers, thread pool, circular buffer |
| Channels | mne | Sensor layouts, channel selections and standard EEG montages; sEEG and ECoG implantations, bipolar montages and surface mapping (channels/ieeg) |
| Pybridge | mne | Running Python scripts and MNE-Python cross-validation from C++ |
| Math | mne | Mathematical algorithms and geometry: linear algebra, optimization, spectral estimation, K-Means, sphere fitting |
| Fs | mne | FreeSurfer surface and annotation I/O |
| Core | mne | The data model independent of file formats: measurement info, channels, digitization, transforms, projections, compensation, raw data, epochs, evoked responses, covariance, events, annotations |
| IO | mne | File formats of the data model: FIFF (io/fiff) — reading and writing raw data, evoked responses, covariances, transforms, events and annotations |
| Mri | mne | MRI volume and coordinate-system I/O (volumes, voxel geometry, transforms) |
| Bids | mne | BIDS dataset reading, writing, path construction, and sidecar metadata handling for iEEG/EEG/MEG |
Processing Libraries
| Library | Namespace | Purpose |
|---|---|---|
| Fwd | mne | Forward modelling: BEM and MEG/EEG lead field computation |
| Inv | mne | Inverse source estimation: MNE, dSPM, sLORETA, beamforming, dipole fitting, HPI fitting, RAP-MUSIC |
| Dsp | mne | Digital signal processing: filtering, spectrograms, real-time averaging, trigger detection, SPHARA, HPI, noise reduction |
| Connectivity | mne | Functional connectivity metrics: Coherence, Cross-Correlation, PLV, PLI, WPLI, and variants |
| Lsl | mne | Lab Streaming Layer (LSL) integration for real-time data exchange |
| Network | mne | TCP and UDP transports with timeouts: connections, servers, datagrams |
| Mna | mne | MNA graph engine: analysis pipeline specification (.mna/.mnx), operator schemas, batch and stream execution |
| Ml | mne | Machine learning: ONNX Runtime inference, linear models, feature pipelines, scalers, tensors; spatial decoders CSP, SPoC, SSD (ml/decoding) |
| Stats | mne | Statistics: t-tests, F-tests, cluster permutation, covariance estimators (Ledoit-Wolf, shrinkage), source-level metrics |
Visualization Libraries
| Library | Namespace | Purpose |
|---|---|---|
| Viz | mne::viz | What the viewers show and how they behave, without a GUI toolkit: figures as display lists (SVG, PNG), trace and brain view logic, GPU frame descriptions with a software renderer, settings forms, view models; HTML reports (viz/report), like mne.Report |
| Viz: Qt Backend | mne::viz::qt | The Qt backend of mne_viz (viz/backends/qt): QRhi rendering (Metal, Vulkan, D3D, OpenGL), windows, 2D plots and viewers, the 3D brain view, Qt item models |
Each library link above leads to its dedicated overview page with the architecture diagram, class inventory, MNE-Python and MNE-C cross-references, code examples, and gap analysis.
Quick navigation
| Section | Description |
|---|---|
| Namespace List | All namespaces with class inventories — one per library |
| Class List | Annotated list of all classes, structs, and unions |
| File List | Source and header files grouped by library directory |
| Class Hierarchy | Inheritance tree showing parent–child relationships |
| Class Members | Index of all public class members (functions, variables, typedefs, enums) |
| Namespace Members | Index of all namespace-level symbols |
External reference
The legacy auto-generated Doxygen HTML reference is still available for cross-checking until this site is fully verified:
| Section | Description |
|---|---|
| Doxygen API Reference | Full auto-generated Doxygen HTML site |
| Namespace List | All namespaces with brief descriptions |
| Class List | Annotated list of all classes, structs, and unions |
| Class Index | Alphabetical class index |
| Class Hierarchy | Inheritance hierarchy |
| Class Members | Index of all class members (functions, variables, typedefs, enums) |
| Namespace Members | Index of all namespace members |
| File List | List of all documented source files |
Generation pipeline
Reproduce locally with
doc/build-api-docs.sh.
The generator refuses to write a sidebar when a registered
documented: true entry has no corresponding Doxygen XML, so the public
surface and the docs stay in lock-step.
Adding a new public class
-
Add an entry to
doc/api_registry.jsonunderclasses:{"name": "MyClass","module": "io","header": "io/fiff/my_class.h","origin": "custom","documented": true,"sidebar_position": 50,"example": "ex_my_class"} -
Make sure the header has Doxygen
/** ... */blocks for the class and every public member you want to surface. -
(Optional) Add a worked example under
src/examples/ex_my_class/and reference its directory name from theexamplefield. The first contiguous block of code frommain.cppis embedded into the generated class page. -
Run
doc/build-api-docs.shand verify your class appears at/api/<module>/<my-class>.