[Mne_analysis] [Freesurfer] question about how to calculate COV for MNE

Alexandre Gramfort alexandre.gramfort at telecom-paristech.fr
Fri Apr 11 03:16:38 EDT 2014
Search archives:

hi,

> I definitely agree about the need to use average reference for source
> modeling, at least for ERPs.  I wasn’t quite sure how it worked in the
> software, especially with regards to projections, which is an aspect of the
> file format that doesn’t seem to be documented except at the general
> conceptual level.
>
> Working backwards from the sample dataset, what I see is that in the chs
> field of the sample_audvis_raw.fif file, there are 60 EEG channels plus a
> common implicit reference electrode (implicit in that its coordinates are
> provided as the reference site for each of the EEG channels but it does not
> have its own entry nor does the data have a waveform for it, which by
> definition would be a flat line of zero voltage).

this channel is meant to be able to undo the referencing.

> Further, I see that the
> cov matrix obtained when running the audvis.cov script has only entries for
> the 60 EEG electrodes but again not the reference site.  This tells me that
> the cov matrix is based on the raw data and is not in average reference
> form, otherwise information would be lost by not including the reference
> electrode in the cov matrix.  Presumably the MNE software whitens the raw
> data directly using the raw cov matrix and only afterwards converts to
> average reference using the appropriate projection.

first whiten and then average reference works since the average ref
is a PCA/SSP with a vector of ones. We can therefore apply it at any stage.
Even multiple times.

> Thanks for the explanation.  It definitely helps me to know how the data
> files are intended to be used.  It sounds like the simplest solution is to
> set the nave field to L_eff and the MNE software will use it to make the
> appropriate scaling.  I don’t need to be modifying the COV matrix itself
> when generating difference waves. I also don’t need to be changing the nfree
> field of the COV data.  This also means I should add a field to my data
> format that keeps track of the L_eff scores so it will be available to
> insert into the nave field when the data is saved in FIFF format.
>
> I think I have everything I need now to implement the preliminary file I/O
> code.  Then I’ll verify by comparing the results to that using just MNE
> software.
>
> I’m still not clear whether I need to make sure that an average reference
> projection is included with the cov matrix and/or the data file so I’ll need
> to work on that bit some more.

see the projs in the measurement info .

> Thanks for taking the time to help me puzzle all this out!

no pb

Alex




More information about the Mne_analysis mailing list