[FieldTrip] Help needed for timelock analysis

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Fri Nov 18 07:49:44 CET 2022


Hi Javier,

Sorry to repeat my self, but you are still not clear.

You ask ‘why is it giving me always the same result despite being completely different EEG signals’.

I don’t understand what ‘it’ is, and I see nowhere in your messages what you mean with ‘completely different EEG signals’. It’s all still Spanish to me.

Different channels? Different simulations? Different step functions? Different noise? How did you do the simulations? How do the simulated signals look? What forward model was used in the simulation? Did you simulate enough variability in the sources’ time courses in order to have a chance to observe spatiotemporal variability at the scalp level? What did you expect from the call to ft_timelockanalysis?

Also, please refer to http://www.catb.org/~esr/faqs/smart-questions.html and https://www.fieldtriptoolbox.org/faq/how_to_ask_good_questions_to_the_community/

Good luck,

Jan-Mathijs


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

Hi Jan,

Sorry for not being clear enough. The question is, how should I apply the timelock function properly? Or, why is it giving me always the same result despite being completely different EEG signals?

Thanks and greetings,
Javier

De: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> En nombre de Schoffelen, J.M. (Jan Mathijs) via fieldtrip
Enviado el: jueves, 17 de noviembre de 2022 17:19
Para: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
CC: Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen at donders.ru.nl<mailto:janmathijs.schoffelen at donders.ru.nl>>
Asunto: Re: [FieldTrip] Help needed for timelock analysis

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$<https://urldefense.com/v3/__https:/doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!7ZVGIVpHujMhbuqj07PjD4_tJOJIGEhEa9EXa1hIOo6IqWXpztkw-y9kXyF9UpcjBTlphhjSrdqGapjwDYPr0saXmetMS6ZuT5is3Q$>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9mv2ZfhmgyQM2cnKYVMi4KmXT2iM-rhDIoKMzszsxvPMLkizmdbFnBJZbfr8a7_O7W5Ao7KPkHOOjvFSJDVKT_VMd2W0uunQbr0MTA$

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20221118/f579bbf6/attachment-0001.htm>


More information about the fieldtrip mailing list