[FieldTrip] Help needed for timelock analysis

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Thu Nov 17 17:19:26 CET 2022


Hi Javier,

What is your question? I don’t manage to distill it from your e-mail.

Best wishes,

Jan-Mathijs


On 17 Nov 2022, at 15:42, Francisco Javier Quirant Agulló via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Hello everyone,

 My name is Javier, I am a student of Biomedical engineering and I am working currently on my final master's project. The project aims to compare various inverse algorithms with some metrics and characterize them.

Right now what I am doing is generating a step signal at source level in 68 different brain sections and obtaining simulated EEG signals with fs = 500 Hz & 2s length (1000 samples) and some noise added. The initial steps are performed using BrainStorm and EEGs are exported to matlab to apply eLORETA and sLORETA with Fieldtrip.

For this I am trying to calculate the time domain information for the signals withft_timelockanalysis and use the results in ft_sourceanalysis. I realized that the source results were identical for the different EEGs (each one for a particular brain section), while the EEGs seem right the output of the ft_timelockanalysis is the same for all signals. Checking the function information I saw a note in line 45 that says: “% FIXME if input is one raw trial, the covariance is not computed correctly”. Tried dividing the EEG in 4 trials but no difference whatsoever. Spent some time also checking results within the function but haven’t made any progress.

I think I may be using the data with an incorrect format or a wrong cfg, any help would be much apreciated. Follows the code.
-----------------------------------
data.trial{1} = real(eeg_01.F);% No idea why but EEGs from BrainStorm convert to complex in matlab
data.time{1} = eeg_01.Time;



save('temp.mat','data');cfg = [];    % This section only when I divide in trials (obviously)
cfg.trialdef.triallength = 0.5;
cfg.datafile = 'temp.mat';
cfg.trialdef.eventtype = 'none';
cfg= ft_definetrial(cfg);
data = ft_preprocessing(cfg);
delete 'temp.mat'



cfg = [];
cfg.covariance = 'yes';
cfg.keeptrials = 'yes';       % I comment these two lines for single trial
cfg.trials = 'all'
data_cov = ft_timelockanalysis(cfg, data);



cfg.layout = 'EEG1010.lay';
ft_topoplotER(cfg,data_cov);   % This to plot the result, I get the same for all EEG files.



-----------------------------------
Here you have the mat file with all variables and 3 of the EEGs already loaded: [https://res-geo.cdn.office.net/assets/mail/file-icon/png/generic_16x16.png] files.mat<https://urldefense.com/v3/__https://upvedues-my.sharepoint.com/:u:/g/personal/fjquiagu_upv_edu_es/EUPygCCic5NEiZak0leUSHsBSJAOKw9aJ_-ae7oibQIhNQ?e=TPWOkC__;!!HJOPV4FYYWzcc1jazlU!7ZVGIVpHujMhbuqj07PjD4_tJOJIGEhEa9EXa1hIOo6IqWXpztkw-y9kXyF9UpcjBTlphhjSrdqGapjwDYPr0saXmetMS6Y5taMH_w$>


I hope everything is clear enought.

Greetings,
Javier
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!7ZVGIVpHujMhbuqj07PjD4_tJOJIGEhEa9EXa1hIOo6IqWXpztkw-y9kXyF9UpcjBTlphhjSrdqGapjwDYPr0saXmetMS6ZuT5is3Q$

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20221117/00ac180d/attachment.htm>


More information about the fieldtrip mailing list