Duneuro forward modeling using containers

This tutorial explains how to compute EEG/MEG forward models with duneuro

using the new container-based integration in Brainstorm.

Using containers allows running duneuro without manually installing

its dependencies or compiling external libraries.


Introduction

Duneuro is an advanced forward modeling tool for EEG and MEG.

It relies on a number of external numerical libraries, which can make

manual installation difficult.

Brainstorm now supports running duneuro using containers,

which package duneuro and all its dependencies in a reproducible environment.

This tutorial demonstrates how to use duneuro through containers

directly from Brainstorm.


Requirements

If you have not installed a container runtime yet, please follow:

?Using Containers with Brainstorm


About containers (short reminder)

Containers allow Brainstorm to run external tools without manual installation

of libraries or compilers.

Note: Docker requires a running daemon (a background service).

Podman and Apptainer do not.


Dataset

This tutorial uses the same example dataset as the standard duneuro tutorial.

You may either:

The exact dataset is not critical for demonstrating the container workflow.


Step 1: Prepare the anatomy

As with any forward modeling approach, you need a subject anatomy.

  1. Import a subject MRI
  2. Compute the cortical surface
  3. Import or generate the head surfaces (scalp, skull, brain)

Refer to the general Brainstorm documentation if needed:

?Anatomy processing


Step 2: Open the forward modeling interface

  1. Select your subject
  2. Right-click on the subject name
  3. Select:
    • Compute head model

In the head model computation panel:


Step 3: Enable container-based execution

In the duneuro options panel:

No manual container commands are required.


Step 4: Container image download

If the duneuro container image is not already available, Brainstorm will

display a confirmation dialog asking whether the image should be downloaded.

After confirmation:

This step is required only once.


Step 5: Compute the forward model

After the container is ready:

  1. Validate the duneuro options
  2. Start the computation

Brainstorm will run duneuro inside the container and retrieve the results

automatically.

From the user perspective, the workflow is identical to a native execution.


Inspecting the results

Once the computation is complete:

For MEG:


Advantages of the container approach

Using duneuro with containers provides several benefits:


Notes and limitations


Summary


See also

Tutorials/DuneuroContainer (last edited 2026-02-09 23:11:32 by TakfarinasMedani)