Reconstructing cortical activity from MEG data

Don’t miss out these videos that are the central components of this post.

Magnetoencephalography (MEG) provides a non-invasive window into the brain’s fast neural dynamics by measuring the magnetic fields generated by electrical currents in neuronal populations. However, to gain understanding of brain function it is necessary to translate what the sensors capture into actual cortical activity. To do that, we need to solve the inverse problems: inferring the locations and strengths of neural sources that produced the observed sensor signals.

For that problem, there is one piece of information that becomes key to solve the inverse: the forward model (a.k.a. leadfield, gain matrix). This model represents how the activation of one source in a specific location would impact each recording channel taking into account the distances, tissues, fluids and conductances that the signal must cross. This representation give us key information, but is not enough. Now, you would need to decide what combination of those sources activations are actually generating the signals recorded and there are infinite possibilities (a bit more of this source, and a bit less of this other; place the activity here, or place the activity there; etc.). That’s why the inverse problem is an ill-posed one.

Several approaches have been developed to approximate reasonable solutions for the inverse problem. This blog post explores four widely used methods for source reconstruction —Minimum Norm Estimate (MNE), dynamic Statistical Parametric Mapping (dSPM), standardized Low Resolution Electromagnetic Tomography (sLORETA), and Linearly Constrained Minimum Variance (LCMV) beamforming— each offering distinct assumptions and strengths. Through video visualizations, we will also compare the impact of dipole orientation constraints and explore brain activity across specific frequency bands.

The forward model: physics and mathematics

The forward model mathematically describes how neural currents in the brain generate magnetic fields measurable by MEG sensors. This is a well-posed problem: given a known distribution of sources, one can compute the sensor-level magnetic fields using Maxwell’s equations and a model of the head’s conductivity. The relationship is linear:

\[B = G J + N\]

where:

  • $B$ is the measured sensor data,
  • $G$ is the lead field matrix (forward model),
  • $J$ is the source current distribution,
  • $N$ represents measurement noise.

The lead field matrix $G$ encapsulates how each unit dipole at each cortical location contributes to the magnetic field at each sensor, considering the head’s geometry and conductivity. This matrix is critical for solving the inverse problem.

Source reconstruction and the inverse problem: ill-posed by nature

In contrast, the inverse problem aims to estimate $J$ given $B$ and $G$. This problem is ill-posed because there are infinitely many possible source configurations that can produce the same external magnetic field. Furthermore, MEG is primarily sensitive to tangential sources, adding another layer of ambiguity.

To make the inverse problem solvable, all source reconstruction methods rely on additional assumptions, constraints or priors (e.g., minimizing current norms, applying statistical normalization, or enforcing spatial smoothness). The forward model $G$ is the cornerstone for computing the inverse solutions, connecting the physiological assumptions to the measured data.

Minimum Norm Estimate (MNE)

MNE (Hämäläinen & Ilmoniemi, 1994) solves the inverse problem by minimizing the norm of the current distribution (minimizing energy, J):

\[\hat{J} = G^\top (G G^\top + \lambda C_n)^{-1} B\]

where:

  • $B$ is the sensor data,
  • $G$ is the lead field matrix,
  • $\lambda$ is the regularization parameter,
  • $C_n$ is the noise covariance matrix.

The solution favors low-amplitude distributed sources and is inherently biased toward superficial currents due to depth attenuation. This depth bias can be observed in the videos below, especially for unconstrained dipoles (look for the MNE brain activity figure). You can appreciate how sulcus and gyrus are highlighted naturally by the activity. This is related to the depth bias.

dynamic Statistical Parametric Mapping (dSPM)

dSPM (Dale et al., 2000) builds on MNE by normalizing each estimated source by the local noise estimate:

\[\text{dSPM} = \frac{\hat{J}}{\sqrt{\mathrm{Var}(\hat{J})}}\]

This results in a z-score-like map, highlighting significant activations and reducing the influence of noise. The standarization of the signals makes it easier to perform statistical comparisons between sources and subjects.

standardized Low Resolution Brain Electromagnetic Tomography (sLORETA)

sLORETA (Pascual-Marqui et al., 2002) introduces an additional spatial smoothness constraint, estimating standardized currents by considering the Laplacian of the solution. This enhances depth localization while maintaining zero localization bias under ideal conditions.

\[\hat{J}_{sLORETA}(r) = \frac{\hat{J}(r)}{\sqrt{\mathrm{Var}[\hat{J}(r)]}}\]

Linearly Constrained Minimum Variance (LCMV)

The LCMV beamformer spatially filters the data to maximize the signal from a target location while minimizing contributions from elsewhere:

\[w = \frac{C^{-1} G}{G^\top C_d^{-1} G}\]

In this case, $C_d$ corresponds to data covariance instead of noise covariance. LCMV assumes sources are uncorrelated and adapts dynamically to the data, making it sensitive to temporal structure but less robust to correlated sources.


The only way to reconstruct source activity implies making assumptions. For instance, the MNE approach assumes that the underlying source activity has minimal energy. Another assumption that could be made based on physiology and the theory of M/EEG recordings is that the dipoles that generate the activity are oriented normal to the cortical surface. This is based on the idea that M/EEG signals are generated by the PSP of pyramidal cells that are part of cortical columns and aligned perpendicular to surface.

Therefore, source models constructed with each of the above-mentioned methods can differ in how they treat the orientation of dipoles (brain sources):

  • Constrained: normal to cortex. Dipoles are fixed to be perpendicular to the cortical surface. This is physiologically plausible, as pyramidal neurons—primary generators of MEG signals—are oriented normal to the cortex. Constrained models reduce the dimensionality of the problem, enhance spatial resolution, and minimize spurious activations.

  • Unconstrained. Dipoles are free to orient in three orthogonal directions at each source point. This increases model flexibility but at the cost of interpretability and susceptibility to noise, as non-physiological orientations may dominate in some regions.

In the first set of videos, you’ll see the same brain activation reconstructed under both scenarios. Expect the unconstrained model to appear more “smeared” and complex, while the constrained model provides sharper, directionally meaningful activations.


Filtering activity into frequency bands

In this second part, I’ll show how these methods reveal activity within canonical brain rhythms by filtering the MEG data into five frequency bands:

Band Frequency Range Typical Function
Delta 2–4 Hz Sleep, homeostasis, motivation
Theta 4–8 Hz Memory, navigation, cognitive control
Alpha 8–12 Hz Visual attention, idling state
Beta 12–30 Hz Motor control, top-down processing
Gamma 30–45 Hz Perception, binding, active processing



Filtering allows us to isolate the cortical dynamics associated with specific cognitive processes. Each band emphasizes different physiological mechanisms, and their cortical projections will look distinct—sometimes local, sometimes widespread—depending on the neural generators.

Conclusion

Comparing these methods and models side by side, we are able to explore how different mathematical assumptions and biological constraints can shape the results of our MEG data analysis and their interpretation. This exercise highlights the complexity of source modeling and may provide insights into the functional significance of brain rhythms.




    Enjoy Reading This Article?

    Here are some more articles you might like to read next:

  • A NMM for epilepsy
  • Jansen-Rit's bifurcation
  • The sigmoid to explain JR's oscillations
  • Dynamic transition through JR's bifurcation
  • JR equations for psychologists