Skip to content

Weighted Minimum Norm Estimate

Solver ID: wMNE

Usage

from invert import Solver

# fwd = ...    (mne.Forward object)
# evoked = ... (mne.Evoked object)

solver = Solver("wMNE")
solver.make_inverse_operator(fwd)
stc = solver.apply_inverse_operator(evoked)
stc.plot()

Overview

Minimum-norm inverse with depth/weighting to reduce superficial bias by scaling the source prior or leadfield columns.

References

  1. Hämäläinen, M. S., & Ilmoniemi, R. J. (1994). Interpreting magnetic fields of the brain: minimum norm estimates. Medical & Biological Engineering & Computing, 32(1), 35–42.
  2. Lin, F.-H., Witzel, T., Ahlfors, S. P., Stufflebeam, S. M., Belliveau, J. W., & Hämäläinen, M. S. (2006). Assessing and improving the spatial accuracy in MEG source localization by depth-weighted minimum-norm estimates. NeuroImage, 31(1), 160–171.

API Reference

Bases: BaseSolver

Class for the Weighted Minimum Norm Estimate (wMNE) inverse solution [1].

References

[1] Grech, R., Cassar, T., Muscat, J., Camilleri, K. P., Fabri, S. G., Zervakis, M., ... & Vanrumste, B. (2008). Review on solving the inverse problem in EEG source analysis. Journal of neuroengineering and rehabilitation, 5(1), 1-33.

Source code in invert/solvers/minimum_norm/wmne.py
class SolverWMNE(BaseSolver):
    """Class for the Weighted Minimum Norm Estimate (wMNE) inverse solution
        [1].

    References
    ----------
    [1] Grech, R., Cassar, T., Muscat, J., Camilleri, K. P., Fabri, S. G.,
    Zervakis, M., ... & Vanrumste, B. (2008). Review on solving the inverse
    problem in EEG source analysis. Journal of neuroengineering and
    rehabilitation, 5(1), 1-33.
    """

    meta = SolverMeta(
        acronym="wMNE",
        full_name="Weighted Minimum Norm Estimate",
        category="Minimum Norm",
        description=(
            "Minimum-norm inverse with depth/weighting to reduce superficial bias "
            "by scaling the source prior or leadfield columns."
        ),
        references=[
            "Hämäläinen, M. S., & Ilmoniemi, R. J. (1994). Interpreting magnetic fields of the brain: minimum norm estimates. Medical & Biological Engineering & Computing, 32(1), 35–42.",
            "Lin, F.-H., Witzel, T., Ahlfors, S. P., Stufflebeam, S. M., Belliveau, J. W., & Hämäläinen, M. S. (2006). Assessing and improving the spatial accuracy in MEG source localization by depth-weighted minimum-norm estimates. NeuroImage, 31(1), 160–171.",
        ],
    )

    def __init__(self, name="Weighted Minimum Norm Estimate", **kwargs):
        self.name = name
        kwargs.setdefault("depth_weighting", 0.5)
        return super().__init__(**kwargs)

    def make_inverse_operator(self, forward, *args, alpha="auto", verbose=0, **kwargs):
        """Calculate inverse operator.

        Parameters
        ----------
        forward : mne.Forward
            The mne-python Forward model instance.
        alpha : float
            The regularization parameter.

        Return
        ------
        self : object returns itself for convenience
        """
        super().make_inverse_operator(forward, *args, alpha=alpha, **kwargs)
        eps = 1e-12
        col_norms = np.linalg.norm(self.leadfield, axis=0) ** float(
            self.depth_weighting
        )
        col_norms = np.maximum(col_norms, eps)
        WTW = np.diag(1.0 / (col_norms**2))
        LWTWL = self.leadfield @ WTW @ self.leadfield.T
        n_chans, _ = self.leadfield.shape

        inverse_operators = []
        for alpha in self.alphas:
            inverse_operator = (
                WTW
                @ np.linalg.solve(
                    LWTWL + alpha * np.identity(n_chans), self.leadfield
                ).T
            )
            inverse_operators.append(inverse_operator)

        self.inverse_operators = [
            InverseOperator(inverse_operator, self.name)
            for inverse_operator in inverse_operators
        ]
        return self

__init__

__init__(name='Weighted Minimum Norm Estimate', **kwargs)
Source code in invert/solvers/minimum_norm/wmne.py
def __init__(self, name="Weighted Minimum Norm Estimate", **kwargs):
    self.name = name
    kwargs.setdefault("depth_weighting", 0.5)
    return super().__init__(**kwargs)

make_inverse_operator

make_inverse_operator(
    forward, *args, alpha="auto", verbose=0, **kwargs
)

Calculate inverse operator.

Parameters:

Name Type Description Default
forward Forward

The mne-python Forward model instance.

required
alpha float

The regularization parameter.

'auto'
Return

self : object returns itself for convenience

Source code in invert/solvers/minimum_norm/wmne.py
def make_inverse_operator(self, forward, *args, alpha="auto", verbose=0, **kwargs):
    """Calculate inverse operator.

    Parameters
    ----------
    forward : mne.Forward
        The mne-python Forward model instance.
    alpha : float
        The regularization parameter.

    Return
    ------
    self : object returns itself for convenience
    """
    super().make_inverse_operator(forward, *args, alpha=alpha, **kwargs)
    eps = 1e-12
    col_norms = np.linalg.norm(self.leadfield, axis=0) ** float(
        self.depth_weighting
    )
    col_norms = np.maximum(col_norms, eps)
    WTW = np.diag(1.0 / (col_norms**2))
    LWTWL = self.leadfield @ WTW @ self.leadfield.T
    n_chans, _ = self.leadfield.shape

    inverse_operators = []
    for alpha in self.alphas:
        inverse_operator = (
            WTW
            @ np.linalg.solve(
                LWTWL + alpha * np.identity(n_chans), self.leadfield
            ).T
        )
        inverse_operators.append(inverse_operator)

    self.inverse_operators = [
        InverseOperator(inverse_operator, self.name)
        for inverse_operator in inverse_operators
    ]
    return self