[Mne_analysis] Get back a reference channel from acticap

Stefan Appelhoff stefan.appelhoff at mailbox.org
Wed Oct 17 04:43:35 EDT 2018
Search archives:

        External Email - Use Caution        

Dear Sylvain, Clemens, and Alex,

regarding the rationale:

- Say you recorded from 10 electrodes and referenced against another 
electrode

- You thus have 11 electrodes, one of which contains a "zero" signal 
(the reference)

- If you now apply the average reference, you are reducing the "rank" of 
the data by one (see: 
https://sccn.ucsd.edu/wiki/Linear_Representations_and_Basis_Vectors#EEG_Data_Reference_and_Re-referencing)

- Usually, the reference electrode is not included in the re-referenced 
data ... so then you will have 10 electrodes and "full rank" data

- The problem arises by including the 11th electrode, because then you 
would have rank deficient data.

- If you then re-reference the rank-deficient, average-re-referenced 
data to mastoids again, you might run into problems (e.g., when trying 
to run ICA).



I am not entirely sure about my reasoning, so another opinion would be 
appreciated.


Best,

Stefan



On 17.10.18 10:16, Sylvain wrote:
>          External Email - Use Caution
>
> Hello Clemens!
>
>
> Well I am saying exactly what you are saying:
> - data are acquired with FCz as the reference channel on the brainvision
> system. I want to retrieve FCz;
> - so I was just about adding back FCz (zeros values), computing the average
> reference (so the new FCz value will be zero minus the mean of other
> channel);
> - then either staying with the average reference or switching to linked
> mastoid.
>
> Now apart from the issues I had with various functions depicted in my
> previous mail I am not 100% sure my rationale is ok.
>
> Now concerning a file here is one (it is compressed) so maybe you can see
> what I was refering to with functions causing issues.
> https://www.dropbox.com/s/9rnf5o391vbxwr6/File_EEG.rar?dl=0
>
> Thanks!
>
> Sylvain
>
>
> On Wed, 17 Oct 2018 07:16:15 +0000
>    "Brunner, Clemens
> (clemens.brunner at uni-graz.at)"	<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?
>>
>> 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



More information about the Mne_analysis mailing list