Re-referencing EEG electrodes in MNE

Hello,

I'm using MNE and MNE-Python to analyze EEG data from a 64 channel biosemi
EEG cap, with no MEG channels, and 2 mastoid EEG channels for reference.
I'd like to re-reference (offline) my EEG channels to the average of the 2
mastoids. Is there a way to do this with either MNE command line or MNE
python? I see that if I wanted to apply an average reference of all EEG
channels, MNE command line stores this as a source space projection. What
would this projection file look like if it were just the 2 mastoid
electrodes?

Thank you and I apologize if this has been addressed in a previous thread.

Regards,
Alan Leggitt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20130930/26d80044/attachment.html

Hi Alan,

I am not aware of a way to do this in a generic manner with MNE/MNE-Python
but it should not be hard.

At what stage of the analysis would you apply the new reference? on
Raw or Evoked?

Maybe you can draft a python function to do this and we can see how to
merge this to mne-python?

best,
Alex

Hi Alan,

The linked mastoids reference should not be used for source modeling. In my mind it is part of EEG heritage that should be definitely dropped.
In general re-referencing operations are not linear projection operations. Average reference is a special case.

You need to write some Python or Matlab code to modify your data if you want to view the EEG in the "linked-ears" format. Again this kind of data should not be used for source modeling purposes.

- Matti

Thanks Matti and Alex for these suggestions, I just wanted to jump in with
another question on the side if that is all right: Matti, is your comment
about linked mastoids relevant specifically to physically linked mastoids,
or also to arithmetically averaged mastoids (that are not physically
linked)? I know the problems with physically linked mastoid channels, but
is it also the case that separate mastoids shouldn't be used as a reference
for source modeling?

Thanks,
Steve

Stephen Politzer-Ahles
New York University, Abu Dhabi
Neuroscience of Language Lab
http://www.nyu.edu/projects/politzer-ahles/

Thanks so much for the feedback. Right now I'm trying to implement this in the raw stage, the rationale being that re-referencing might reduce the number of epochs that are rejected by amplitude threshold. I don't want to do this with an average reference, since I know that I have some noisy channels that I need to exclude.

I was playing around with this yesterday and I came up with a crude solution. I've attached my python code.

Although I eventually want to move to source modeling, right now I'm interested in using MNE to do ERP and spectral analysis, instead of using something Matlab based like EEGLAB. Would you recommend re-referencing in this context?

While I'm on the subject, EEGLAB recommends specifying a reference channel when import eeg data from a .bdf file. Their rationale ...

% WARNING! Biosemi Active II data
% are recorded reference-free, but LOSE 40 dB of SNR
% if no reference is used!. If you do not know which
% channel to use, pick one and then re-reference after
% the channel locations are read in. {default: none}

Is this also a problem with mne_edf2fiff ?

Thanks again,
Alan Leggitt

Hi Alan,

I moved the discussion to :

let me know if you want to give it a try.

the raw stage, the rationale being that re-referencing might reduce the
number of epochs that are rejected by amplitude threshold. I don't want to
do this with an average reference, since I know that I have some noisy
channels that I need to exclude.

you should mark your channels as bad first

I was playing around with this yesterday and I came up with a crude
solution. I've attached my python code.

Although I eventually want to move to source modeling, right now I'm
interested in using MNE to do ERP and spectral analysis, instead of using
something Matlab based like EEGLAB. Would you recommend re-referencing in
this context?

yes if you want to see something that matches the ERP topography

While I'm on the subject, EEGLAB recommends specifying a reference channel
when import eeg data from a .bdf file. Their rationale ...

% WARNING! Biosemi Active II data
% are recorded reference-free, but LOSE 40 dB of SNR
% if no reference is used!. If you do not know which
% channel to use, pick one and then re-reference after
% the channel locations are read in. {default: none}

Is this also a problem with mne_edf2fiff ?

I don't know. I guess it's due to limited precision used for storing
floating point values

hope this helps

Alex