Papers
Topics
Authors
Recent
Search
2000 character limit reached

Brainstorm-DUNEuro: EEG/MEG FEM Workflow

Updated 8 July 2026
  • Brainstorm-DUNEuro is an integrated forward-modeling pipeline that combines Brainstorm’s user-friendly neuroimaging environment with DUNEuro’s robust finite-element engine for bioelectromagnetic simulations.
  • The workflow employs individualized MRI, diffusion imaging, and advanced meshing techniques to generate realistic head models with both isotropic and anisotropic conductivity assignments.
  • The integration enables precise lead-field computation for EEG, MEG, and custom electrode applications, achieving high accuracy and robust validation metrics.

Brainstorm-DUNEuro denotes an integrated finite-element forward-modeling workflow in which Brainstorm serves as the user-facing neuroimaging environment and DUNEuro serves as the numerical engine for electroencephalography (EEG) and magnetoencephalography (MEG) forward computation. In this combined usage, individualized magnetic-resonance-imaging-based head models are generated inside Brainstorm, compartment conductivities are assigned isotropically or, for white matter, anisotropically from diffusion-weighted imaging, and the resulting finite element model is passed to DUNEuro for lead field computation. The combined framework is therefore best understood not as a single monolithic solver but as a Brainstorm-centered pipeline for realistic bioelectromagnetic forward modeling, later extended in published work to custom implanted-electrode lead-field studies and to questions about how finite-element source models interact with inverse solvers (Medani et al., 2020, Schrader et al., 2019, Medani et al., 16 Aug 2025).

1. Definition and scope

Brainstorm-DUNEuro addresses the electromagnetic forward problem for brain activity: the prediction of scalp potentials, intracranial potentials, or external magnetic fields at sensors for a given putative neural source configuration. The motivating premise is that modern MRI data permit subject-specific volume conductor models with multiple tissue compartments and, where available, anisotropic conductivity information, rather than older simplified sphere models. Within this scope, Brainstorm provides data management, anatomy handling, sensor handling, source-space definition, visualization, and workflow control, whereas DUNEuro provides the finite element machinery needed to solve the forward model on realistic geometries (Medani et al., 2020).

DUNEuro itself is a free, open-source C++ toolbox for forward modeling in bioelectromagnetism, built on top of the DUNE framework. Its stated focus is advanced finite element modeling for EEG and MEG in realistic head geometries, including multiple tissue compartments, tensor-valued conductivities, fitted and unfitted formulations, and several source discretization schemes. For Brainstorm-centered workflows, this makes DUNEuro a backend for lead fields and transfer matrices rather than a replacement for higher-level analysis software (Schrader et al., 2019).

The combined term “Brainstorm-DUNEuro” has also been used in later application papers for the open-source FEM pipeline itself, especially when Brainstorm and DUNEuro were jointly used to compute lead fields for implanted directional depth electrodes and to compare those lead fields against commercial FEM software (Medani et al., 16 Aug 2025).

2. Integrated software architecture

At the architectural level, Brainstorm and DUNEuro have distinct roles. Brainstorm is the orchestration layer: it manages anatomical images, cortical surfaces, sensors, source spaces, visualization, and a workflow available through both a graphical interface and a batch editor. In the integrated pipeline, Brainstorm calls external tools for segmentation, diffusion processing, and mesh generation, then passes the resulting FEM head model together with source and sensor definitions to DUNEuro for lead field computation. The Brainstorm paper explicitly presents this as an accessibility and integration contribution rather than as a new forward theory (Medani et al., 2020).

DUNEuro organizes its own internals through a coarse-grained MEEGDriverInterface, with FittedMEEGDriver for geometry-fitted methods and UnfittedMEEGDriver for geometry-independent, level-set-based methods. Each driver is parameterized by a Solver and a SourceModelFactory. This separation allows external environments such as Brainstorm or Matlab scripts to request lead fields or transfer matrices at a high level while DUNEuro handles assembly, linear solves, and source-model-specific right-hand-side construction internally. The toolbox also exposes Matlab and Python interfaces, with analogous configuration patterns across languages (Schrader et al., 2019).

The Brainstorm-side preprocessing stack integrates multiple external packages. Segmentation is performed through SPM from within Brainstorm. Meshing may call headreco from SimNIBS, brain2mesh, or the head reconstruction process from ROAST. If anisotropic conductivity modeling is requested, Brainstorm calls the BrainSuite Diffusion Pipeline to estimate diffusion tensors from diffusion-weighted imaging. In a later custom electrode study, Brainstorm was combined with Iso2mesh for tetrahedral FEM mesh generation, showing that the Brainstorm-DUNEuro workflow is extensible beyond the default cortical EEG/MEG use case (Medani et al., 2020, Medani et al., 16 Aug 2025).

3. Anatomical modeling, meshing, and conductivity assignment

The canonical Brainstorm-DUNEuro head-model-generation workflow starts from a T1-weighted MRI and, if available, a T2 image. If anisotropic conductivity is desired, diffusion-weighted imaging is additionally provided. The final head model is divided into five main compartments: white matter, grey matter, CSF, skull, and scalp. These segmented regions are converted into a finite element mesh, with either tetrahedral or hexahedral meshes available, and conductivity values are then assigned by tissue class (Medani et al., 2020).

For isotropic compartments, Brainstorm assigns widely-used default conductivity values from the literature, although the numerical values are not listed in the cited paper’s text. For anisotropic tissues, the implemented default pathway is specific to white matter: diffusion tensors are estimated from DWI by the BrainSuite Diffusion Pipeline and converted into conductivity tensors using the effective medium approach. The resulting conductivity tensors are assigned elementwise to white matter FEM elements. The paper is explicit that white matter is the main anisotropic compartment in the described implementation, while grey matter, CSF, skull, and scalp are handled isotropically by default (Medani et al., 2020).

The example dataset used to demonstrate the integrated pipeline employed headreco to construct a tetrahedral FEM mesh, included white matter conductivity tensors estimated from T1w/T2w and DWI data, and defined a source space comprising 15,000 cortical dipoles together with 74 EEG electrodes and 275 MEG sensors. Brainstorm describes the lead field matrix as mapping every cortical dipole to every sensor (Medani et al., 2020).

DUNEuro broadens the geometric and conductivity scope beyond that specific Brainstorm example. In fitted methods, it supports geometry-conforming tetrahedral and hexahedral meshes, with a VolumeConductor object storing the grid and conductivity tensor associated with each element. In unfitted methods, geometry is represented implicitly by level-set functions on an auxiliary domain, with cut-cell integration handling tissue interfaces. The practical consequence is that Brainstorm-DUNEuro can support both classical geometry-conforming meshing and workflows in which tissue boundaries are represented weakly rather than by a conforming volumetric mesh (Schrader et al., 2019).

4. Forward formulation, transfer matrices, and source models

For EEG, DUNEuro formulates the forward problem on a heterogeneous conductive head domain Ω\Omega as

σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega

with insulating outer boundary condition

(σu)n=0on Ω,(\sigma\nabla u)\,n = 0 \quad \text{on }\partial\Omega,

where σ\sigma is a symmetric positive definite conductivity tensor and the dipolar primary current is modeled through

jp=Mδx0.\nabla\cdot j^p = M\cdot\nabla\delta_{x_0}.

After discretization, the system has the form Ax=bAx=b, sensor outputs are written as U=RxU=Rx, and the transfer-matrix construction gives U=RA1bU=RA^{-1}b. Defining T:=RA1T:=RA^{-1} yields Tb=UTb=U, and because σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega0 is symmetric, σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega1 can be computed row-wise by solving σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega2. This transfer-matrix formulation is central to high-throughput lead-field generation in Brainstorm-style source-space scans (Schrader et al., 2019).

For MEG, DUNEuro computes the magnetic field through a Biot–Savart formulation using the total current density, with the secondary current given by σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega3. The paper notes that for discontinuous Galerkin MEG, using σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega4 directly is suboptimal and that numerical fluxes should instead be used for the secondary field (Schrader et al., 2019).

A defining feature of DUNEuro is the explicit support for multiple finite-element source models. The implemented set depends on discretization scheme. For CG-FEM, partial integration, St. Venant, subtraction, and Whitney source models are available for EEG/MEG. For DG-FEM, partial integration and subtraction are implemented for EEG/MEG. For UDG, partial integration and subtraction are implemented for EEG. The Whitney source model is currently only available for tetrahedral meshes, and for DG-MEG the numerical-flux implementation of the secondary field is currently only available for hexahedral meshes (Schrader et al., 2019).

Brainstorm exposes this source-model layer through cortical dipoles obtained from nodes of the cortical surface and corrected following Venant’s condition. In a later implanted-electrode application, Brainstorm-DUNEuro was used with a continuous Galerkin formulation and a Venant source model, with dipoles oriented along σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega5, σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega6, and σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega7, and Brainstorm returned the lead-field matrix directly in the form

σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega8

This shows that the Brainstorm integration can support both conventional cortical source spaces and highly customized recording geometries (Medani et al., 2020, Medani et al., 16 Aug 2025).

5. Demonstrated workflows and empirical validation

The initial Brainstorm integration paper presented a proof-of-integration on published data from a healthy adult subject including T1w, T2w, DWI, EEG, and MEG, specifically the WWU DUNEuro reference dataset. The resulting five-compartment head model, white matter conductivity tensors, EEG lead fields, and MEG lead fields were visualized in Brainstorm. For comparison, the authors also computed the MEG solution using the overlapping spheres method already available in Brainstorm and reported that both FEM and OS showed good concordance. The same paper states that EEG and MEG were fully tested and validated at that time, whereas iEEG was part of the broader scope but not demonstrated in comparable detail (Medani et al., 2020).

A later study on high-resolution directional depth electrodes used Brainstorm-DUNEuro as the open-source FEM pipeline for source-to-sensor lead fields in sEEG-like recording problems. In that work, Brainstorm plus Iso2mesh generated tetrahedral meshes; refinement was concentrated near electrodes and conductivity discontinuities; the HD-sEEG region of interest used tetrahedra with edge length around σu=jpin Ω\nabla\cdot\sigma\nabla u = \nabla\cdot j^p \quad \text{in }\Omega9–(σu)n=0on Ω,(\sigma\nabla u)\,n = 0 \quad \text{on }\partial\Omega,0 mm; the directional lead-field study used a regular (σu)n=0on Ω,(\sigma\nabla u)\,n = 0 \quad \text{on }\partial\Omega,1 mm source grid with 68,921 test dipoles; and the localization study used a (σu)n=0on Ω,(\sigma\nabla u)\,n = 0 \quad \text{on }\partial\Omega,2 mm grid with around 800k sources. Because the Brainstorm GUI did not yet support the custom probe geometry at publication time, MATLAB scripts were used to import the custom geometry into the Brainstorm pipeline (Medani et al., 16 Aug 2025).

That same study provided the clearest quantitative validation of Brainstorm-DUNEuro as a custom-electrode FEM platform. In spherical benchmarks against analytical solutions, all solvers achieved RDM < 5%, MAG (σu)n=0on Ω,(\sigma\nabla u)\,n = 0 \quad \text{on }\partial\Omega,3, and CC (σu)n=0on Ω,(\sigma\nabla u)\,n = 0 \quad \text{on }\partial\Omega,4r > 95\%(σu)n=0on Ω,(\sigma\nabla u)\,n = 0 \quad \text{on }\partial\Omega,5\ln \mathrm{MAG} = 0.02$, and CC = 98%. The study further showed a substrate shielding effect: contacts facing a source had higher sensitivity than contacts shadowed by the insulating shaft, and this directional effect largely disappeared when the shaft conductivity was set equal to the surrounding tissue (Medani et al., 16 Aug 2025).

The same application paper used Brainstorm for source localization with FEM lead fields derived from Brainstorm-DUNEuro. Reported localization errors for the full HD-sEEG configuration were typically under 1 mm, whereas standard sEEG generally ranged between 0.5 and 2 mm and mini-sEEG showed the greatest variability, with some dipoles exceeding 3.5 mm. The paper attributes this improvement to informative voltage differences across dense directional contacts, although it also notes that the modeling comparison was asymmetric because realistic shaft geometry and conductivity were only included for the full HD-sEEG configuration (Medani et al., 16 Aug 2025).

6. Methodological issues, interpretive limits, and ecosystem context

Several limitations are explicit in the Brainstorm and DUNEuro literature. The Brainstorm integration paper is intentionally high-level: it does not provide detailed mathematical derivations, conductivity tables, mesh-quality metrics, or quantitative benchmarks across mesh types, source models, or FEM variants. It also limits the explicit implemented compartmentalization to five tissues and does not discuss skull sublayers, lesions, implants, eyes, or air cavities. Installation and dependency management remain nontrivial because the pipeline relies on multiple external tools (Medani et al., 2020).

The DUNEuro toolbox paper likewise emphasizes architecture and supported methods more than exhaustive benchmarking. At the time described there, DUNEuro was developed and used on Linux systems; mixed FEM and finite-volume schemes were not yet implemented in the fitted category; the Whitney source model was only available for tetrahedral meshes; and a comprehensive direct benchmark against tools such as SimBio was still underway. These are not merely software-engineering details, because forward-model accuracy and practical usability are both conditioned by discretization choice, source-model availability, and mesh type (Schrader et al., 2019).

A further methodological issue, highlighted in later work, is that the DUNEuro source model is not a neutral implementation choice. A 2026 study comparing DUNEuro and Zeffiro-based FEM source models argues that inverse performance depends strongly on whether the forward source model matches the inverse prior. In that study, Local subtraction is described as yielding the most accurate point-source model and pairing especially well with sparse or dipole-oriented inverse methods such as sHAL1R and Dipole Scanning, whereas source models with weaker source separation may be better suited to inversion models that assume wider distributions, such as sLORETA and SKF. This suggests that Brainstorm-DUNEuro configuration should be treated as a joint forward–inverse design problem rather than as a one-time forward-model choice (Söderholm et al., 22 Apr 2026).

The ecosystem boundary is also clear. Some recent EEG/MEG software papers are Brainstorm-adjacent without being part of the Brainstorm-DUNEuro stack. For example, MLE-Toolbox is positioned as interoperable with Brainstorm and useful for source localization workflows, but it is explicitly stated not to mention DUNEuro at all and not to describe finite-element source modeling of the kind typically associated with DUNEuro. A plausible implication is that “Brainstorm-DUNEuro” should be reserved for workflows in which Brainstorm is actually coupled to the DUNEuro FEM backend, rather than for Brainstorm interoperability in a generic sense (Liu, 8 Apr 2026).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Brainstorm-DUNEuro.