Restore a reference electrode

Dear mne users,

we're recording EEG with a 64 electrodes cap, using Oz as reference.
The final data are in brainvision format and when I call raw.info, the list
chs has 64 items:
63 EEG and 1 STIM.
For further analysis reasons (topomaps etc.) I would like to reconstruct
the Oz channel,
so to have 64 EEG channels.

My idea was to use, after epoching:

mne.add_reference_channels(epochs_clean, 'Oz', copy=False)
epochs_clean.info['bads'] = ['Oz']
epochs_clean.interpolate_bads()

Does it make any sense or am I missing some fundamental theoretical issue?
(For example interpolating could introduce some redundant information).

Later I want to calculate an evoked object, so I thought about
re-referencing to average:

epochs_clean.set_eeg_reference(ref_channels=None)

but I get this error:
*Cannot add an average EEG reference projection since a custom reference
has been applied to the data earlier.*

So I thought to bypass the error using add_channels() but I believe that
this is not really what I'm looking for.

Thank you in advance for any help,

LA

MSc student, University of Padova
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170105/4b092055/attachment.html

Dear Lorenzo

EEG records voltage, which is the difference in electric potential between two points. The voltage between a reference electrode and itself is always zero. Interpolating this channel from the surrounding channels will give you approximately the same answer: the voltage at the reference electrode is zero.

The mne.add_reference_channels function will add the reference channel for you set it to zero.

This means that when you use channel Oz as a reference channel, you will not be able to clearly see occipital activity (activity in that region will translate to an inverse of this activity in the frontal regions). In this case it makes sense to transform to an average reference. With this reference, the voltage will reflect the difference in electric potential between each electrode and the mean of all electrodes. This is usually easier to interpret.

A call to set_eeg_reference(ref_channels=None) should accomplish this. The error you get is related to MNE being hesitant to move from some custom reference to an average reference (this limitation has been removed in the development version of MNE). What kind of reference did you use when extracting the epochs? At any rate, you can disable the error message by manually setting epochs_clean.info[?custom_ref_applied?] = False.

Hope this helps!

Marijn.

Dear Marijn,
thank you very much for your answer, it really clarified my ideas about
this issue.
I didn't apply any other reference before extracting the epochs so I guess
it's still Oz (even if I'm not able to see that channel). I will defenately
use the average reference!
Again, this really helped, thank you.

Lorenzo