[FieldTrip] data structure not fieldtrip compatible after eeglab2fieldtrip conversion

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Tue Mar 5 07:46:38 CET 2019


Dear community,

Please see the forwarded message below. It seems as if eeglab2fieldtrip needs to be updated in order to return data structures that are robustly compatible with the fieldtrip code. I suspect that some necessary fields need to be adjusted/added. No doubt some of you have run into this and I would appreciate if you could contribute a solution with an updated version of eeglab2fieldtrip through a pull request on github.

Best wishes and happy computing,

Jan-Mathijs

J.M.Schoffelen, MD PhD
Associate PI, VIDI-fellow - PI, language in interaction
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands





Begin forwarded message:

From: Aiyush Bansal <aiyush.bansal at mail.utoronto.ca<mailto:aiyush.bansal at mail.utoronto.ca>>
Subject: LCMV Beamformer in Fieldtrip
Date: 5 March 2019 at 04:20:29 GMT+1
To: "jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>" <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>

Dear Dr. Schoffelen,


I'm using an EEG data structure and want to use the fieldtrip toolbox to perform the LCMV Beamformer algorithm as outlined in this tutorial: http://www.fieldtriptoolbox.org/tutorial/beamformer_lcmv/

Localizing sources using beamformer techniques - FieldTrip toolbox<http://www.fieldtriptoolbox.org/tutorial/beamformer_lcmv/>
www.fieldtriptoolbox.org<http://www.fieldtriptoolbox.org/>
Averaging and computation of the covariance matrix. The function ft_timelockanalysis makes averages of all the trials in a data structure and also estimates the covariance.



I converted the EEG data to fieldtrip using:

data=eeglab2fieldtrip(EEG,'preprocessing','none');

Then, I tried to compute the covariance matrix using:

cfg                  = [];
cfg.covariance       = 'yes';
timelock             = ft_timelockanalysis(cfg, data);


Note, that in order to use ft_timelockanalysis function, the data has to be organized in a structure obtained from ft_preprocessing but that function is built for fieldtrip data and I had already sent 'preprocessing' as one of the arguments to eeglab2fieldtrip.

In any case, as soon as I call ft_timelockanalysis, I get the following error:

Reference to non-existent field 'dimord'.

Error in dimlength (line 74)
      elseif strcmp(data.(fld), 'rpt_pos')

Error in fixsampleinfo (line 49)
  ntrial = dimlength(data, 'rpt');

Error in ft_datatype_timelock (line 146)
      timelock = fixsampleinfo(timelock);

Error in ft_checkdata (line 270)
  data = ft_datatype_timelock(data, 'hassampleinfo', hassampleinfo);

Error in ft_timelockanalysis (line 101)
data = ft_checkdata(data, 'datatype', {'raw+comp', 'raw'}, 'feedback', 'yes', 'hassampleinfo', 'yes');


All of this works with the dataset included as part of the tutorial. I've tried to compare the structure of the two data sets and I've noticed that the data obtained from eeglab2fieldtrip is missing several fields. The data in these fields is already in the eeglab data but it wasn't added which is why the ft_timelockanalysis is failing since those fields don't exist.

Hence, I was wondering if you could please know what the problem could be or if there is a way to fix this. All I am trying to do is this LCMV Beamformer analysis which I have only been able to find in fieldtrip. My data is in eeglab.

Sincerely,


Aiyush Bansal, M.D.
MASc Candidate - IBBME
University of Toronto
CAMH, Temerty Centre

t. (647) 825-6865
e. aiyush.bansal at mail.utoronto.ca<mailto:shaurya.gupta at mail.utoronto.ca>




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190305/1c6b71d9/attachment-0001.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list