Contextual Minimum-Norm Estimate (CMNE) inverse solver — deep-learning-corrected dSPM (Dinh et al. 2021). More...
#include "../inv_global.h"#include "../inv_source_estimate.h"#include "inv_cmne_settings.h"#include <Eigen/Core>#include <Eigen/Dense>

Go to the source code of this file.
Classes | |
| struct | INVLIB::InvCMNEResult |
| CMNE result. More... | |
| class | INVLIB::InvCMNE |
| CMNE inverse solver. More... | |
Namespaces | |
| namespace | UTILSLIB |
| Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms). | |
| namespace | INVLIB |
| Inverse source estimation (MNE, dSPM, sLORETA, dipole fitting). | |
Contextual Minimum-Norm Estimate (CMNE) inverse solver — deep-learning-corrected dSPM (Dinh et al. 2021).
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
INVLIB::InvCMNE implements the CMNE algorithm of Dinh et al., Contextual Minimum-Norm Estimates: A Deep Learning Method for Source Estimation in Neuroimaging, 2021, and matches the reference implementation, the cmne Python package (0.2.1). The static compute method combines a closed-form dSPM kernel with the contextual re-weighting of Eqs. 9-13: the dSPM estimate is rectified and z-scored (q), and for t >= k an LSTM, run in ONNX Runtime, predicts the next estimate from the previous k contextual estimates b; q_t is weighted by the max-normalised |prediction|. Without a model the paper's control estimate is returned. The trainLstm helper drives the Python training pipeline (scripts/ml/training/train_cmne_lstm.py) through UTILSLIB::PythonRunner so the full train-and-deploy cycle is reachable from C++ without leaving the mne-cpp process.
Definition in file inv_cmne.h.