Tutorial 4: Channel file / MEG-MRI coregistration

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.


This dataset (MEG and MRI data) was collected by the MEG Unit Lab, McConnell Brain Imaging Center, Montreal Neurological Institute, McGill University, Canada. The original purpose was to serve as a tutorial data example for the Brainstorm software project. It is presently released in the Public Domain, and is not subject to copyright in any jurisdiction.

We would appreciate though that you reference this dataset in your publications: please acknowledge its authors (Elizabeth Bock, Peter Donhauser, Francois Tadel and Sylvain Baillet) and cite the Brainstorm project seminal publication.

Presentation of the experiment


  • One subject, two acquisition runs of 6 minutes each.
  • Subject stimulated binaurally with intra-aural earphones (air tubes+transducers), eyes opened and looking at a fixation cross on a screen.
  • 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
  • Downsampled at a lower sampling rate: from 2400Hz to 600Hz: The only purpose for this resampling is to make the introduction tutorials easier to follow the on a regular computer.

  • 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_600Hz.ds: Run #1, 360s, 200 standard + 40 deviants

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

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

  • Average reaction times for the button press after a deviant tone:
    • Run #1: 515ms +/- 108ms

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

Head shape and fiducial points

  • 3D digitization using a Polhemus Fastrak device driven by Brainstorm (S01_20131218_01.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).

Automatic registration

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

Defaced volumes

When processing your own datasets, if your MRI images are defaced, you might need to proceed in a slightly different way. The de-identification procedures remove the nose and other facial features from the MRI. If your digitized head shape includes points on the missing parts of the head, this may cause an important bias in automatic registration. In this case it is advised to remove the head points below the nasion before proceeding to the automatic registration, as illustrated in this tutorial.

New files and folders

Many new files are now visible in the database explorer:

Each of these new folders show two elements:

Review vs Import

When trying to bring external data into the Brainstorm environment, a common source of confusion is the difference between the two popup menus Review and Import:

Display the sensors

Right-click on the CTF channels file and try all the display menus:



Sensor map

Here is a map with the full list of sensor names for this CTF system, it could be useful for navigating in the recordings. Click on the image for a larger version.



Manual registration

If the registration you get with the automatic alignment is incorrect, or if there was an issue when you digitized the position of the fiducials or the head shape, you may have to realign manually the sensors on the head. Right-click on the channel file > MRI Registration:

There is nothing to change here, but remember to always check the registration scalp/sensors.


Multiple runs and head positions

Between two acquisition runs the subject may move in the MEG helmet, the relative position of the MEG sensors with the head surface changes. At the beginning of each MEG run, the positions of the head localization coils are detected and used to update the position of the MEG sensors.


Edit the channel file

Display a table with all the information about the individual channels. You can edit all the values.


On the hard drive

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

Structure of the channel files: channel_*.mat

Useful functions


Additional documentation

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

Tutorials/ChannelFile (last edited 2020-11-22 10:15:01 by FrancoisTadel)