[Mne_analysis] Get back a reference channel from acticap

Phillip Alday phillip.alday at mpi.nl
Wed Oct 17 06:05:18 EDT 2018
Search archives:

        External Email - Use Caution        

On 10/17/2018 11:47 AM, Sylvain wrote:
>         External Email - Use Caution        
> 
> Hey Philip,
> 
> 
> Sadly I have a system with the reference being plugged with an external 
> strand and located on FCz.
> I have trouble understanding the difference between an "internal" reference 
> and FCz itself. I do not know but to me it seems that at the end the voltage 
> recorded at every electrode is just the difference with FCz. What is the 
> difference with it being internal?

That's a very good question -- I haven't found anything in the Brain
Products documentation to make it clear what exactly their internal
reference is. If you have an explicitly marked FCz reference electrode
though and are using the standard workspaces, then it's the reference
channel and it's safe to add it back in as a bunch of zeros.

> I really prefer the way it is working with Biosemi since CMS is not located 
> on a position of the standard1020. 

It actually doesn't matter too much where your online reference is (as
long as you have electrodes at where your final reference will be),
because of the math of re-referencing. Voltage is inherently a
difference, so if your online reference is FCz then the voltage at every
channel is:

v_chan = efield_chan - efield_fcz

(and by definition, v_fcz is 0).

Then to re-reference, you just subtract out the voltage at the desired ref

v_chan_newref = v_chan - v_newref = efield_chan - efield_fcz -
(efield_newref - efield_fcz) = efield_chan - efield_newref

And then

v_fcz_newref = 0 - v_newref

v_newref = v_newref - v_newref = 0

So if you have electrodes on the mastoids and an online FCz reference,
then you can just re-reference to the mastoids offline.

> Anyway I disgress but just for maybe 
> further acquisition do you think it would be ok if I just plug the REF (so 
> the FCz electrode supposedly) to a mastoid (since I wont use the mastoid for 
> any analysis).

That's fine -- in PyCorder and BrainVision Recorder, you can even
relabel the channel to reflect your actual recording setup.

Phillip


> I know it is not directly linked to MNE so please apologize if I disgress.
> 
> Sylvain
> 
> On Wed, 17 Oct 2018 11:21:57 +0200
>   Phillip Alday <phillip.alday at mpi.nl> wrote:
>>        External Email - Use Caution        
>>
>>
>> On 10/17/2018 09:16 AM, Brunner, Clemens 
>> (clemens.brunner at uni-graz.at)
>> wrote:
>>>         External Email - Use Caution        
>>>
>>> Hi Sylvain!
>>>
>>> Can you upload your file to your Dropbox or Google Drive and share 
>>> the link?
>>>
>>> In general, your approach makes sense to me, but I don't really 
>>> understand why your Brainamp has an average reference electrode. This 
>>> doesn't make sense, because an average reference is by definition the 
>>> average of all involved channels, which means you cannot have a 
>>> dedicated electrode for this. Maybe the data are collected with a FCz 
>>> reference, and then they are re-referenced to average afterwards?
>>
>> This is exactly what happens on the actichamp system. Depending on 
>> your
>> cap layout and hardware revision, FCz is either a "normal" electrode 
>> or
>> a blue reference electrode that is in a separate cable strand like 
>> the
>> ground electrode is. You can see this when you're setting up the cap 
>> and
>> doing impedance measurements -- all of your impedances will be 
>> really
>> horrible until you set up FCz.
>>
>> As Stefan hypothesized later, FCz is then left out after the 
>> internal
>> reference is applied (their terminology, see
>> https://www.brainproducts.com/productdetails.php?id=42&tab=2 ; but I
>> suspect that it's essentially an average reference or an approximate 
>> way
>> of doing the reference at infinity like in REST) so that the data 
>> are
>> full rank and "reference free".
>>
>> (I really, really hate that term -- I think some BioSemi systems use 
>> it
>> to, but their physical reference electrode is labeled "CMS" for
>> "common-mode sensor".)
>>
>> Phillip
>>
>>>
>>> Anyway, I think the actual file would help us track down your issue.
>>>
>>> Clemens
>>>
>>>
>>>> On 16.10.2018, at 16:58, Sylvain <madec at uni-potsdam.de> wrote:
>>>>
>>>>        External Email - Use Caution        
>>>>
>>>> Ok here is the code for replicating the error:
>>>>
>>>>
>>>> import mne
>>>> import pandas as pd
>>>> import numpy as np
>>>> from mayavi import mlab
>>>> %matplotlib inline
>>>> %gui qt
>>>>
>>>>
>>>> # Open EEG file
>>>> data_path = '/home/sylvain/Desktop/Participant01'
>>>> raw_fname = data_path + '/Participant01.vhdr'
>>>>
>>>> ## Error further in the code (when adding reference channel) if I 
>>>> open the 
>>>> file this way
>>>> #raw_file = mne.io.read_raw_brainvision(raw_fname,
>>>> #                                  event_id={"actiCAP Data On": 
>>>> 9999},
>>>> #                                  montage = 'standard_1020',
>>>> #                                  preload=True)
>>>>
>>>> # The error diseapear if i just use this
>>>> raw_file = mne.io.read_raw_brainvision(raw_fname,
>>>>                                   event_id={"actiCAP Data On": 
>>>> 9999},
>>>>                                   preload=True)
>>>>
>>>>
>>>> raw_file = mne.io.add_reference_channels(raw_file, ['FCz'])
>>>>
>>>> raw_file.set_montage('standard_1020')
>>>> raw_file.plot_sensors()
>>>>
>>>>
>>>> Do you know where I could stock the file it is quite big?
>>>>
>>>> Thank you
>>>>
>>>> Sylvain
>>>>
>>>> On Tue, 16 Oct 2018 16:50:41 +0200
>>>>  Alexandre Gramfort <alexandre.gramfort at inria.fr> wrote:
>>>>>       External Email - Use Caution        
>>>>>
>>>>> please share a file and code snippet so we better understand the 
>>>>> issue
>>>>> and we can document it and eventually help people not having this 
>>>>> problem again.
>>>>>
>>>>> if you have an issue, it's very likely someone else will have it 
>>>>> too.
>>>>>
>>>>> Alex
>>>>>
>>>>> _______________________________________________
>>>>> Mne_analysis mailing list
>>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>>
>>>>
>>>> _______________________________________________
>>>> Mne_analysis mailing list
>>>> Mne_analysis at nmr.mgh.harvard.edu
>>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>
>>>
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> 
> 
> 
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> 



More information about the Mne_analysis mailing list