Skip to content

MNE-CPP v2.4.0

Latest

Choose a tag to compare

@chdinh chdinh released this 28 Oct 07:48

Intracranial EEG support, new signal-processing methods, and faster 3D visualization.

MNE-CPP 2.4.0 adds dedicated sEEG/ECoG analysis and visualization, approximately 60 MNE-Python-aligned implementations, and faster 3D rendering in desktop and browser applications. It also introduces new workflows in MNE Scan and MNE Analyze, extends scientific file-format support, and connects the documentation with runnable examples.

970 commits since v2.3.0.

Highlights

  • Intracranial EEG: The new mne_ieeg library supports depth, strip, and grid electrodes, bipolar referencing, coordinate transforms, and cortical projection of contact values. MNE Inspect adds interactive sEEG/ECoG visualization on desktop and in the browser.
  • Signal processing and analysis: New and aligned methods cover FIR filtering, ECG/EOG artifact handling, spectral and time–frequency analysis, statistics, events, source estimation, and digitization formats.
  • 3D visualization across platforms: Desktop and WebAssembly builds now share a rendering path, fixing longstanding WebGL issues and improving source-estimate animation and interaction performance.
  • Application improvements: MNE Scan adds 3D head-motion trajectories; MNE Analyze extends event handling and condition-based averaging; MNE Inspect gains electrode-value overlays and improved session handling.
  • Documentation and examples: Guides, API documentation, and examples are linked by scientific topic. A new Get Started guide and 29 new CI-tested example programs make workflows easier to explore and reproduce.
  • Interoperability and validation: New compatibility functions and approximately 60 cross-validation suites compare results with MNE-Python 1.11 and related scientific tools.

New libraries and scientific APIs

Intracranial EEG: mne_ieeg

  • IeegImplantation groups depth, strip, and grid contacts into leads, manages coordinate transforms, and reads/writes BIDS iEEG group and dimension fields.
  • IeegReference constructs sparse bipolar derivations with MNE-Python-compatible channel names such as LA1-LA2.
  • IeegSurfaceMap projects electrode values onto the cortex using sum, single, nearest, or weighted mapping.
  • The new ex_ieeg example demonstrates the workflow.
  • MNE Inspect loads electrode positions from BIDS *_electrodes.tsv, supports electrode selection, and displays contact values on cortical surfaces.

Signal processing and analysis

  • Filtering and artifacts: MNE-compatible FIR design (FirFilter::designMne, filterData, firwin2), ECG/EOG peak detection and SSP projectors, EOG regression, and artifact annotations.
  • Time–frequency analysis: Welch and multitaper PSD/CSD, Morlet and multitaper TFR, DPSS parameterization, and DC removal.
  • Statistics: Permutation t-tests, adjacency construction, Benjamini–Yekutieli FDR, rejection masks, and chi-square inverse survival functions.
  • Evoked and source data: FiffEvoked::combine, FiffEvokedSet::save, applyForward, estimateSnr, gradeToVertices, growCircularLabel, and MNE-Python-compatible hemisphere-pair STC export.
  • Events and channels: Event selection, merging, counting, concatenation, trigger-step detection, fixed-length event creation, and channel selection by type or regular expression. Channel types now include sEEG, ECoG, DBS, fNIRS, and eye tracking.
  • Digitization and transforms: Readers for Polhemus Isotrak/FastSCAN, BrainProducts CapTrak, EGI MFF, Localite, and Neuroscan; head-to-MNI-to-Talairach transforms.
  • FIFF and MNE-C interoperability: FIFF tag descriptions, tree inspection, layouts, derivations, morph maps, and additional covariance utilities.
  • Workflow execution (MNA): Input verification, provenance records (versions, host, SHA-256 hashes, timing), and comparison expressions in parameters.

Applications and visualization

  • MNE Scan: 3D head-motion trajectories from continuous HPI, coil frequencies read from measurements, improved plugin loading and shutdown, clearer logging, and restored bundled resources.
  • MNE Analyze: Events with durations, trigger codes, and types; annotation bands; averages by trigger code; saving averages; improved BEM and dipole loading; and automated 3D rotation.
  • MNE Inspect: sEEG/ECoG visualization, electrode-value overlays, MRI-coordinate dipoles, and restored view layout and zoom.
  • MNE Analyze Studio: Offline mode, workflow preview, FIFF viewing on Linux, and visible kernel/skill errors.
  • MNE Browse: Event markers respect per-event colors.
  • 3D views: Faster source animation and picking, automated rotation, screenshots, electrode interaction, and head-motion paths. Fixed WebGL frames, source-estimate thresholds, dipole placement, and several display and coregistration issues.
  • Command-line tools: Restored or corrected EDF/Eximia conversion, BEM generation, morph maps, derivations, transform handling, dipole fitting, and grand averages. Tools now report failures through non-zero exit codes and stderr.
  • Real-time: Corrected UTC offsets, CTF compensation, and discovery of local LSL streams.

Performance

The following measurements are from the reported benchmark cases, not general speedup guarantees:

Operation Before v2.4.0
Source-estimate animation (two pial surfaces) 4.4 ms/frame 1.9 ms/frame
Hover highlighting 10 ms < 1 µs
Ray picking 1.6 ms ~1 µs
Example FIR filtering workload 13 s 18 ms

FIR filtering now uses power-of-two FFTs, and Hilbert envelopes use an FFT-based implementation. The browser renderer also avoids uploading unchanged geometry every frame.

Validation and fixes

Cross-validation with MNE-Python 1.11, SciPy, NiBabel, and MNE-BIDS has been expanded across scientific workflows. The following selected corrections are particularly relevant for users comparing results with previous releases.

Source estimation, forward modelling, and beamformers

  • Corrected minimum-norm kernels (previously 0.8% off), eLORETA estimates (up to a factor of 2–4), loose eLORETA normalization (24% discrepancy), and loose dSPM noise norms (17% discrepancy).
  • Fixed depth priors, fixed-orientation inverse solutions, source normals, label-restricted estimates, and multiple covariance and whitening errors.
  • Corrected LCMV/DICS whitening, regularization, source orientation, rank handling, and channel alignment.
  • Fixed convergence or source-selection defects in MxNE, TF-MxNE, Gamma-MAP, RAP-MUSIC, and TRAP-MUSIC.
  • Fixed crashes in spherical forward modelling, incorrect MEG/EEG gradients, source-space downsampling, and magnetic-dipole fits (previously up to 18 mm off in the documented case).
  • Corrected SSP handling and parameter interpretation in dipole fitting, including --grid, guess radius, and --magdip.

Preprocessing, statistics, and spectral analysis

  • Corrected epoch alignment, baseline boundaries, rejection criteria, evoked averages, and real-time averaging across trigger codes.
  • Fixed SSP and covariance estimation, saved-filtered-data alignment, and unintended filtering of trigger channels.
  • Corrected SSS basis handling, Morlet power scaling (previously about 88 times too large), PSD/CSD normalization, and real-time noise spectra.
  • Fixed cluster-statistic thresholds, TFCE grids, extreme-tail p-values, FDR settings, and permutation p-value calculation.
  • Corrected connectivity correlation values and channel-position assignment.

Data formats and interoperability

  • EDF/BDF: Fixed EDF amplitudes incorrectly divided by 10⁶, BDF samples decoded as 16-bit, and errors in headers and channel types.
  • FIFF: Corrected byte order, event-file serialization, UTF-8 strings, channel selection, evoked calibration, and reading of files with acquisition skips or missing data.
  • BIDS/BrainVision: Fixed electrode-to-channel assignment, units, coordinate frames, BIDS entity naming, and BrainVision ASCII parsing.
  • MNE Browse: Fixed exported EEG/EOG/STI values that were 3,276.8 times too large, along with annotation duration and event-export issues.
  • CTF, FreeSurfer, and MRI: Corrected compensation, surface geometry, and coordinate-transform issues, including crashes on truncated files.
  • BEM solutions written by MNE-CPP are now readable by MNE-C and MNE-Python.

Reproducibility note: Some fixes change numerical results or exported values. If earlier analyses used affected functionality, check the differences and consider recomputing relevant results.

Developer notes

Breaking changes

  • Renamed: The 3D display types moved to DISP3DLIB; PickResult became RayHit; MNE Scan's rtcmne plugin became rtclustmne (RtClustMne). Unix deployment uses scripts/deploy/deploy.sh; deploy.bat is Windows-only.
  • Changed defaults: FiffCoordTrans::read reads the first transform (use readTransform(from, to) to select one); MNEForwardSolution::read retains bad channels; Welch PSD removes DC; CSD omits the DC bin; KMeans uses singleton handling for empty clusters; standard montage locations match MNE-Python.
  • Changed values: sEEG/ECoG/DBS FIFF channel kinds use values 802/902/803, respectively; BIDS writes the recording entity instead of rec.
  • Changed signatures and ownership: FIFF writers, checkIntegrity(), and FiffEvokedSet::compensate_to return bool; ownership-transferring factories return std::unique_ptr; CircularBuffer is non-copyable.
  • Removed: ElectrodeArray, ElectrodeContact, and ElectrodeLayout (use IeegImplantation); the EDFReader scale factor and mne_edf2fiff --scaleFactor; MNEHemisphere::getTriCoords; the older FIFF explanation helpers (use FiffExplain); and MNE Browse's MnxProject (use the MNA project container).
  • Other integration changes: MNE Scan's bad-channel resource is now babymeg_bad_channels.txt; the MNE Analyze event shared-memory key is versioned.

Testing, build, and documentation

  • Approximately 60 scientific cross-validation suites compare stored reference outputs with MNE-Python 1.11 and related tools; the function-coverage inventory documents 443 MNE-Python APIs.
  • CI now runs 34 previously skipped tests; 26 unregistered tests were identified. Tests have labels and timeouts and run against the oldest and newest supported Qt versions.
  • Reported line coverage: libraries 89%, applications 56%, tools 61%; library branch coverage 65%.
  • Compiler warnings are errors on all target platforms, including WebAssembly. The codebase uses clang-format 21.1.8, tracks clang-tidy regressions, and checks for dependency cycles.
  • Added 29 compiled, CI-tested example programs. Public API classes include example snippets; the Doxygen reference builds without warnings, and CI generates and checks manual screenshots.
  • The manual, API reference, and examples now cross-link by scientific topic. A new Get Started guide covers a first program against an installed MNE-CPP; the examples directory can be filtered by task, recording type, level, and library.
  • Updated build and deployment workflows, documented release-candidate checks, and added SECURITY.md. A weekly CI job tests the published build instructions on clean Linux, macOS, and Windows environments.
  • Dependencies and versions are tracked in src/external/external_deps.env, including Qt, Emscripten, and ONNX Runtime.

Downloads, signing, and verification

The macOS applications and disk images are Developer ID signed and notarized. The SignPath pipeline for Windows, including product-version checks on MNE-CPP binaries, is implemented; however, all v2.4.0 Windows downloads are unsigned because production signing is not yet active. Windows signing will be available only after the SignPath release-signing policy is activated.

Asset Status
mne-cpp-2.4.0-macos-dynamic-arm64.dmg Signed, notarized, stapled
mne-cpp-2.4.0-macos-installer-arm64.dmg Signed, notarized, stapled
mne-cpp-2.4.0-windows-dynamic-x86_64.zip Unsigned
mne-cpp-2.4.0-windows-installer-x86_64.exe Unsigned
mne-cpp-2.4.0-windows-static-x86_64.zip Unsigned
All other release assets SHA-256 checksums published

All release assets are listed in SHA256SUMS. To check downloaded files, run sha256sum -c SHA256SUMS --ignore-missing on Linux or shasum -a 256 -c SHA256SUMS on macOS. A checksum verifies file integrity against the published checksum; it is not a substitute for a publisher signature.

Unsigned Windows applications may trigger Microsoft Defender SmartScreen. Verify the GitHub release URL and the published checksum before deciding whether to run them. For details, see the code signing policy.

macOS packages now support macOS 14.4 and later, subject to the bundled Qt minimum.

Release history: This publication replaces the original v2.4.0 tag from October 22, 2026, which was withdrawn.

Contributors

Christoph Dinh; Eric Larson (#1013); Andreas Griesshammer (@ag-fieldline, #1003); and dependency updates by Dependabot.