Reference Electrode


I’ve got EEG data that is referenced to the average of two electrodes, whose identity and position I know. (The referencing is a sort of computational linked mastoid A1+A2 type reference). Is there a way to represent this in the Channel struct() for lead field calculation? For example, if I set the comment fields for both of these electrodes to ‘EEG REF’ and all other comment fields as empty, will BrainStorm use the average of these two channels as the reference?


Hi Kevin,

My suggestion would be that you import your data and then switch referencing to ‘Average’, which moves your reference from linked mastoids to instantaneous average potential. I am sure there is a way to switch references within brainstom, so if you can handle that before you import your data, that will certainly work.

Hi Sylvain,

Thank you for a speedy reply. I only use some of the low-level BrainStorm functions in my own code (basically just the .m files/scripts that compute the leadfield), so I just want to make sure I understand what you’re telling me.

I could easily computationally re-reference my data to average potential (outside of BrainStorm). Is your suggestion for me to do so, and then when interfacing with BrainStorm (say, creating the channel struct) use average referencing?

I also take your answer to mean that computing a leadfield using a channel struct where 2/64 electrodes are set to ‘EEG REF’ will not result in proper behavior. Is this so?

Thanks for the further clarification, and for all your help, as usual.


That’s right. You need to create a new channel structure where all ‘Comment’ fields of the EEG channel bear the keyword: ‘AVERAGE REF’ and therefore remove the reference electrodes from your montage.

Hi Kevin,

Here are some answers and remarks:
[li] There is currently no support for EEG references. Setting a channel’s type to “EEG REF” will just exclude it from the EEG channels list, as if you had classified as “Other” or “XXX”.
[/li][li] The EEG values are save in Brainstorm exactly as they were read in the input files (except a conversion from mV or microV to Volts for some formats), and then they are ONLY processed in average reference: At each time, the average across all the channels in subtracted from each channel.
[/li][li] This average reference is always computed on the fly, from the current list of valid electrodes (type=‘EEG’, and that are not marked as “bad” in the ChannelFlag array). So it is always possible to go back to the initial values, and to add or remove channels, but it is impossible to re-reference the data.
[/li][li] Anyway, re-referencing would not make any different for the computation of the leadfield or the localization of the sources, as we only consider the average reference.
[/li][li] There was a part of the code that previously was trying to use the information of the EEG references in the computation of the leadfield. But 1) in most cases we do not have enough information to reconstruct the leadfield for the references, 2) no one was able to fix this code to make it stable with any configuration of reference. So this efforts were abandoned.
[/li][li] We are probably going to integrate new forward models from the OpenMEEG toolbox before the end of the year. This might change completely the way EEG is managed in Brainstorm, and we may have to add again the full support for EEG references.
[/li][li] It is highly NOT recommended that you use directly the low-level functions for the computation of the leadfield. They are considered as non-documented and their stand-alone use is not supported anymore. Brainstorm is now supposed to be an integrated application, not a “toolbox”, ie. a library of specific functions, like FieldTrip or OpenMEEG are. All the structures are meaningful only in the context of a full database.
[/li][li] If you just want to compute leadfields for EEG, you should think about using OpenMEEG, or OpenMEEG models through FieldTrip, which may offer a better quality for EEG leadfields, without the risks of obtaining wrong results using the functions in a wrong way.
[/li][li] If you were a user of the previous Brainstorm distribution (v.2), please give a try to the new one, read the tutorials and try to use this intuitive GUI.

Hope that answers all your questions.


Thank you. Your answers are extremely helpful and most appreciated. I suppose I should take a look at FieldTrip; I have significant chunks of home-grown code (currently MATLAB) and the BrainStorm GUI is just too much overhead for what I want to do.

I appreciate your help!