Fitting dipoles with FieldTrip

Authors: Jeremy Moreau, Francois Tadel

This tutorial introduces dipole fitting and visualization in Brainstorm. You will need to have completed the introduction tutorials up to "Tutorial 16: Average response" before undertaking this tutorial. This tutorial explains how to fit dipoles to time series within Brainstorm. If you already have computed dipole fits using CTF DipoleFit or Neuromag XFit and would like to import them in Brainstorm, see this tutorial.

Warning: This function does not work properly with FieldTrip versions released between 2015-10-05 and 2016-01-15. If you are using a version released around this time, update FieldTrip first.


This process wraps the FieldTrip function ft_dipolefitting. For using FieldTrip within Brainstorm, read these instructions. For background information on the implementation of the dipole modeling see the FieldTrip dipole fitting tutorial or watch this video.

Process FieldTrip: ft_dipolefitting

Process options

Visualizing dipole files

Multiple dipoles

In the two examples above, we fitted one single dipole at each time point. This approach is expected to work well if we assume that there is one active source only at each time point. This is not the case here as we expect a bilateral auditory response to this binaural sitmulus. We obtained results that look meaningful (dipoles close to the auditory regions) because the response we recorded is stronger on the left side, but with a truly symmetrical response we could have obtained a dipole in the center of the head. This approach is globally wrong for multiple sources.

If you expect to observe two sources of activity simultaneously, then you need to either fit two dipoles at the same time, or to use a distributed source model. However, there are difficult methodological problems that come with multiple dipole fitting: Do you fit first a dipole and then fit a second one to the residuals? Do you try to optimize the two dipoles at once? Obtaining correct results usually requires an accurate manual initialization of the dipoles parameters, and a lot of user supervision over the process.

Let's see what happens if we ask the FieldTrip function to fit two dipoles, in order to explain the activity of the left and right auditory cortices simultaneously.


Single dipole fitting is great to identify focal sources in the brain, when there are no other co-occurring events. It can be particularly convenient to localize the focus area of epileptic spikes, as shown in tutorial EEG and epilepsy: Dipole fitting.

When more than one region of the brain might be involved, we recommend using distributed source models (surface or volume), that are much better able to represent multiple sources simultaneously. Screen captures below from the tutorial : Volume source estimation.

Merging dipole files

You may sometimes want to visualize multiple sets of dipoles together on the same MRI viewer. For instance, you may have fit dipoles to a series of individual epileptic spikes, and would like to see whether the dipoles form a cluster. In the context of this tutorial, we are going to merge the M50 dipole file with the M100 dipole file, so that we can see where they localise relative to each other.

Additional documentation

<<EmbedContent: execution failed [[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)] (see also the log)>>

Tutorials/DipoleFitting (last edited 2020-02-28 16:44:22 by FrancoisTadel)