Tutorial 4: Co-registration MEG-MRI

Authors: Francois Tadel, Elizabeth Bock, Sylvain Baillet

The anatomy of your subject is ready. Before we can start looking at the MEG/EEG recordings, we need to make sure that the sensors (electrodes, magnetometers or gradiometers) are properly aligned with the MRI and the surfaces of the subject.

In this tutorial, we will start with a detailed description of the experiment and the files that were recorded, then we will link the original CTF files to the database in order to get access to the sensors positions, and finally we will explore the various options for aligning these sensors on the head of the subject.

Auditory dataset

This dataset used in the introduction tutorials is the same as the one used in the MEG Auditory tutorial:


This tutorial dataset (MEG and MRI data) remains a property of the MEG Lab, McConnell Brain Imaging Center, Montreal Neurological Institute, McGill University, Canada. Its use and transfer outside the Brainstorm tutorial, e.g. for research purposes, is prohibited without written consent from the MEG Lab.

If you reference this dataset in your publications, please aknowledge its authors (Elizabeth Bock, Peter Donhauser, Francois Tadel and Sylvain Baillet) and cite Brainstorm as indicated on the website. For questions, please contact us through the forum.

Presentation of the experiment


  • One subject, two acquisition runs of 6 minutes each
  • Subject stimulated binaurally with intra-aural earphones (air tubes+transducers)
  • Each run contains:
    • 200 regular beeps (440Hz)
    • 40 easy deviant beeps (554.4Hz, 4 semitones higher)
  • Random inter-stimulus interval: between 0.7s and 1.7s seconds, uniformly distributed
  • The subject presses a button when detecting a deviant with the right index finger
  • Auditory stimuli generated with the Matlab Psychophysics toolbox
  • The specifications of this dataset were discussed initially on the FieldTrip bug tracker:

MEG acquisition

  • Acquisition at 2400Hz, with a CTF 275 system, subject in sitting position

  • Recorded at the Montreal Neurological Institute in December 2013
  • Anti-aliasing low-pass filter at 600Hz, files saved with the 3rd order gradient
  • Recorded channels (340):
    • 1 Stim channel indicating the presentation times of the audio stimuli: UPPT001 (#1)
    • 1 Audio signal sent to the subject: UADC001 (#316)
    • 1 Response channel recordings the finger taps in response to the deviants: UDIO001 (#2)
    • 26 MEG reference sensors (#5-#30)
    • 274 MEG axial gradiometers (#31-#304)
    • 2 EEG electrodes: Cz, Pz (#305 and #306)
    • 1 ECG bipolar (#307)
    • 2 EOG bipolar (vertical #308, horizontal #309)
    • 12 Head tracking channels: Nasion XYZ, Left XYZ, Right XYZ, Error N/L/R (#317-#328)
    • 20 Unused channels (#3, #4, #310-#315, #329-340)
  • 3 datasets:
    • S01_AEF_20131218_01.ds: Run #1, 360s, 200 standard + 40 deviants

    • S01_AEF_20131218_02.ds: Run #2, 360s, 200 standard + 40 deviants

    • S01_Noise_20131218_01.ds: Empty room recordings, 30s long

    • File name: S01=Subject01, AEF=Auditory evoked field, 20131218=date(Dec 18 2013), 01=run
  • Average reaction times for the button press after a deviant tone:
    • Run #1: 515ms +/- 108ms

    • Run #2: 596ms +/- 134ms

  • Use of the .ds, not the AUX (standard at the MNI) because they are easier to manipulate in FieldTrip

Head shape and fiducial points

  • 3D digitization using a Polhemus Fastrak device driven by Brainstorm (S01_20131218_*.pos)

  • More information: Digitize EEG electrodes and head shape

  • The output file is copied to each .ds folder and contains the following entries:
    • The position of the center of CTF coils
    • The position of the anatomical references we use in Brainstorm:
      Nasion and connections tragus/helix, as illustrated here.

  • Around 150 head points distributed on the hard parts of the head (no soft tissues)

Registration method

The registration between the MRI and the MEG (or EEG) is done in two steps. We start with a first approximation based on three reference points, then we refine it with the full head shape of the subject.

Step 1: Fiducials

Step 2: Head shape

Channel file

Many new files are now visible in the database explorer:

From auditory

Multiple runs and head position

From CTF

Channel file

Let's explore what you can do with the first file. Right-click on the CTF channels file and try all the menus.


The menus in the Display menu display the same thing, but in a different way. You can add the scalp (or cortex) surface easily with the toolbar in the Surfaces tab, in the main window (Add a surface "+" button).

channelCtf.gif channelHelmet.gif channelMeg.gif

Display a table with all the information about the individual channels. You can use this window to view and edit the channels properties.


The channel file describes each channel separately, with the following information:

For the moment, the registration between anatomy and sensors is based only on three points that are manually positioned (nasion and ears). This rough alignment technique is quite robust but also very imprecise, and depends on the precision with which the people defined the fiducials, both during the data acquisition and on the MRI slices. For this reason, it is sometimes necessary to correct the position of the sensors.

There is nothing to change here, but remember to always check the registration scalp/sensors just after you import MEG or EEG recordings.

Before locking your subject into that dark shielded room, when you acquire the position of some reference points with a magnetic tracking system (eg. Polhemus Isotrak), it is a good practice to acquire also many other points at the surface of the head. It does not take a very long time but provides very valuable information to register properly the MEG sensors with the MRI and surfaces. The more head points the better, with a minimum of 50 or 100, avoiding the softer parts of the head (cheeks, base of the neck, ears, eyes) because they may have different shapes when the patient is sitting on the MEG chair and when he/she is laying down in the MR scanner. Always insist on the nose, it provides a really good indicator of the orientation of the head.

Note: The digitization of the head shape and the head localization coils with a Polhemus device can be done with Brainstorm: see the digitize tutorial.

Some other fields are present in the channel file that cannot be accessed with the Channel editor window. You can explore those other fields with the File menu, selecting View file contents or Export to Matlab. As we saw in previous tutorial.


Some fields you may find there:

Feedback: Comments, bug reports, suggestions, questions
Email address (if you expect an answer):

Tutorials/ChannelFile (last edited 2015-02-06 21:23:31 by FrancoisTadel)