Digitize EEG sensor locations and head shape

Authors: Elizabeth Bock

Getting Started

The Brainstorm Digitize application allows for a connection to a Polhemus device and collection of digitized head points and/or EEG sensor locations.

The application is designed for two receivers (i.e. the stylus and reference) and one transmitter.

The connection to the device is made via a serial port connection. This can be accomplished using a direct serial connection or with a USB-to-Serial cable connection to the host computer.

Configuration of the Polhemus

Fastrak or Isotrak



Figure 1. Polhemus system with two receivers and one transmitter


Figure 2. Typical Polhemus setup

The application is designed for two receivers (i.e. the stylus and reference) and one transmitter.

The stylus is used by the operator to point to the desired position for collection

The reference is fixed to the subject’s head, typically with glasses or headband. While the subject’s head can move during the collection, the reference sensor should not move from the starting position relative to the head.

The transmitter is fixed behind the subject, typically to a non-metal chair or table. The orientation is shown here, with X+ pointing up and Y+ point to the right.


Figure 3. Transmitter orientation

****Care should be taken when setting up this system to ensure accurate collection. Thorough testing should be performed using known head coordinates (phantom) to determine accuracy.

The head coordinate system used in the Digitize application is based on the CTF head coordinate system, see CoordinateSystems.

The Digitize GUI

Before starting the GUI, turn on the Polhemus unit and wait until the indicator light is green.

To start the Digitize application, start Brainstorm. Then select ‘Digitize’ from the File Menu.


Figure 4. Starting Digitize

The Brainstorm GUI will be hidden during the use of the Digitize application and will reappear after exiting Digitize.


Figure 5. Digitize GUI

This application allows you collect:

The collection can performed by:

If an error is made during collection:

When complete the coordinates can be save in a variety of formats including CTF (*.pos), megDraw (*.eeg) or tab-delimited ASCII text.

Edit Settings

Settings for the serial connection and point collection can be adjusted using the ‘Edit settings’ menu option from the Digitize File Menu and may vary for each user.


Figure 6. Edit Settings


Figure 7. Edit settings dialog

Serial port name – this is the name of the serial port that is connected to the Polhemus, for example COM1 (Windows), ttyS1 (Linux).

Unit Name – this will select the settings for the specific device. Fastrak and Isotrak will both use the name fastrak.

Digitize MEG HPI coils - this will allow for collection of the positions of the HPI coils. This is important for CTF users since the data collected from the MEG system is saved in HPI coil coordinate system. Users collecting only EEG sensors or just head shape will not collect these points.

Number of times to collect the three fiducials – these collections will occur at the beginning of the session and will be averaged together to compute the transformation to the HPI or head coordinate system.

Beep – this will generate a beep sound with each point collection (this is often helpful to realize a button press on the stylus when there is one operator).

EEG Montages


Figure 8. Edit EEG settings

There are three options for EEG sensors:


EEG settings should be adjusted for each session. Custom montages that are imported are stored in the brainstorm preferences and are available on subsequent sessions.

The Coordinates list on the left panel of the GUI displays the labels of the points which have been selected for collection. This is vary depending on the number of times the fiducials are collected and the number of EEG sensors to be defined. The head shape points are not listed since this will vary depending on the individual need.


Figure 10. Example EEG setups


Collect the required number of HPI coils


Figure 11. Collect coils

Collect the required number of Anatomical Fiducials


Figure 12. Collect fiducials

Collect the required number of EEG points

Collect the desired number of head shape points


Figure 13. Collect head shape


Export points to text file

All points are automatically saved in a brainstorm channel file


Figure 14. Export points to text file

How to use this file with CTF systems

The procedure we recommend is the following:


There are several things that can affect the quality and reproducibility of the measurements from the Polhemus Fastrak:

Device communication

Problem appears to be with the communication between the device and Brainstorm:

  1. Power on the device
  2. Restart Matlab
  3. Start brainstorm
  4. Start Digitize
  5. At the Matlab command prompt, type this: s = instrfind()

If you do not have Matlab, you can open a command prompt from the Brainstorm File menu BEFORE starting Digitize. The command, s = instrfind() should be typed into the window, click execute and see the output in the terminal window.:


Figure 15: Start command window from Brainstorm


Figure 16: Serial connection settings (Fastrak)

  1. From the Digitize->File->Edit settings (Figure 7), confirm the information in 's' matches your settings

  2. Confirm the information in 's' matches your COM port settings of your computer (this info is in the Device Manager)
  3. Press the button of the stylus, then execute s = instrfind() again. You should see that there are bytes available (94 bytes for Fastrak, 120 bytes for Patriot).


Figure 17: Serial connection after one point collected (Fastrak)


Additional documentation

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

Tutorials/TutDigitize (last edited 2022-06-02 09:43:16 by FrancoisTadel)