Back to the main page.

Bug 3366 - implement REST re-referencing for EEG data

Status NEW
Reported 2017-10-23 06:42:00 +0200
Modified 2017-10-24 05:06:51 +0200
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Mac OS
Importance: P5 normal
Assigned to: Li Dong
URL:
Tags:
Depends on:
Blocks:
See also:

Robert Oostenveld - 2017-10-23 06:42:06 +0200

as discussed in Chengdu


Robert Oostenveld - 2017-10-23 06:50:24 +0200

This bugzilla page is for discussion of the new feature. The actual code (and possibly the more detailled discussion of that code) is managed on our github page at http://www.fieldtriptoolbox.org/development/git Can you please confirm that you can access http://github.com/fieldtrip/fieldtrip? If so, I propose you read through the tutorial at http://www.fieldtriptoolbox.org/development/git


Robert Oostenveld - 2017-10-23 07:02:18 +0200

re-referencing is now implemented in ft_preprocessing for the high-level interface that is explained at http://www.fieldtriptoolbox.org/tutorial/preprocessing_erp. The high-level interface helps with data management (channel selection etc). The low-level code works as follows ft_preprocessing.m calls private/preproc.m, which in turn calls preproc/ft_preproc_rereference.m In the last function we now have methods 'avg' and 'median'. Furthermore, the function gets a list of channels that is to be considered for the reference. Please have a look at ft_preproc_rereference. We may extend that function with the method 'rest'. Since this function is often called many times (for each trial or data segment), I suspect that the computational overhead might be too large. The alternative that I therefore see is that we implement the REST reference as a "montage". This is a structure that, together with the data, is handled by ft_preprocessing as cfg.montage. In this case, the low-level code works as follows ft_preprocessing.m calls private/preproc.m, which in turn calls forward/ft_apply_montage.m To understand the montage, please check ft_apply_montage. It is basically a matrix multiplication (newdat = montage.tra * olddat) with the bookkeeping of the channels (rows and columns).


Li Dong - 2017-10-24 05:06:51 +0200

I have a look at ft_preproc_rereference. We may extend that function with the method 'rest' first. One input of the method 'rest' is leadfield matrix. Therefore, I suggest to calculate leadfield matrix using FieldTrip first (especially using real head modal); i.e., to add an input of leadfield matrix G, instead of calculating leadfield matrix in modified ft_preproc_rereference.m. Maybe we can add an input of leadfield in function ft_preprocessing.m (such as cfg.G, channels X sources), if user want to re-refer to REST. I will work on this function first, and test it next step.