← 输入框|mne-cpp.github.io|刷新
Skip to main content

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​

LibraryNamespacePurpose
BasemneFoundation of every library: logging, error results, byte streams, string and path helpers, thread pool, circular buffer
ChannelsmneSensor layouts, channel selections and standard EEG montages; sEEG and ECoG implantations, bipolar montages and surface mapping (channels/ieeg)
PybridgemneRunning Python scripts and MNE-Python cross-validation from C++
MathmneMathematical algorithms and geometry: linear algebra, optimization, spectral estimation, K-Means, sphere fitting
FsmneFreeSurfer surface and annotation I/O
CoremneThe data model independent of file formats: measurement info, channels, digitization, transforms, projections, compensation, raw data, epochs, evoked responses, covariance, events, annotations
IOmneFile formats of the data model: FIFF (io/fiff) — reading and writing raw data, evoked responses, covariances, transforms, events and annotations
MrimneMRI volume and coordinate-system I/O (volumes, voxel geometry, transforms)
BidsmneBIDS dataset reading, writing, path construction, and sidecar metadata handling for iEEG/EEG/MEG

Processing Libraries​

LibraryNamespacePurpose
FwdmneForward modelling: BEM and MEG/EEG lead field computation
InvmneInverse source estimation: MNE, dSPM, sLORETA, beamforming, dipole fitting, HPI fitting, RAP-MUSIC
DspmneDigital signal processing: filtering, spectrograms, real-time averaging, trigger detection, SPHARA, HPI, noise reduction
ConnectivitymneFunctional connectivity metrics: Coherence, Cross-Correlation, PLV, PLI, WPLI, and variants
LslmneLab Streaming Layer (LSL) integration for real-time data exchange
NetworkmneTCP and UDP transports with timeouts: connections, servers, datagrams
MnamneMNA graph engine: analysis pipeline specification (.mna/.mnx), operator schemas, batch and stream execution
MlmneMachine learning: ONNX Runtime inference, linear models, feature pipelines, scalers, tensors; spatial decoders CSP, SPoC, SSD (ml/decoding)
StatsmneStatistics: t-tests, F-tests, cluster permutation, covariance estimators (Ledoit-Wolf, shrinkage), source-level metrics

Visualization Libraries​

LibraryNamespacePurpose
Vizmne::vizWhat 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 Backendmne::viz::qtThe 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​

SectionDescription
Namespace ListAll namespaces with class inventories — one per library
Class ListAnnotated list of all classes, structs, and unions
File ListSource and header files grouped by library directory
Class HierarchyInheritance tree showing parent–child relationships
Class MembersIndex of all public class members (functions, variables, typedefs, enums)
Namespace MembersIndex 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:

SectionDescription
Doxygen API ReferenceFull auto-generated Doxygen HTML site
Namespace ListAll namespaces with brief descriptions
Class ListAnnotated list of all classes, structs, and unions
Class IndexAlphabetical class index
Class HierarchyInheritance hierarchy
Class MembersIndex of all class members (functions, variables, typedefs, enums)
Namespace MembersIndex of all namespace members
File ListList 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​

  1. Add an entry to doc/api_registry.json under classes:

    {
    "name": "MyClass",
    "module": "io",
    "header": "io/fiff/my_class.h",
    "origin": "custom",
    "documented": true,
    "sidebar_position": 50,
    "example": "ex_my_class"
    }
  2. Make sure the header has Doxygen /** ... */ blocks for the class and every public member you want to surface.

  3. (Optional) Add a worked example under src/examples/ex_my_class/ and reference its directory name from the example field. The first contiguous block of code from main.cpp is embedded into the generated class page.

  4. Run doc/build-api-docs.sh and verify your class appears at /api/<module>/<my-class>.