[FieldTrip] ft_timelockanalysis outputs average data with different trial lengths

Singh, Tarkeshwar singht at musc.edu
Mon Oct 3 17:34:18 CEST 2016


Dear All,

I am new to Fieldtrip and am trying to compare ERPs between two conditions using the following lines of code. ‘data_iccleaned’ is the processed data structure. The code below is in red and my message in black.

cfg=[];
cfg.keeptrials = 'yes';
cfg.vartrllength=1;
cfg.trials = find(data_iccleaned.trialinfo(:,1) == 1);
erp_pictures = ft_timelockanalysis(cfg, data_iccleaned);
cfg=[];
cfg.keeptrials = 'yes';
cfg.vartrllength=1;
cfg.trials = find(data_iccleaned.trialinfo(:,1) == 2);
erp_abstract = ft_timelockanalysis(cfg, data_iccleaned);

%Baseline Correction
cfg=[];
cfg.baseline = [twin(1) 0];
erp_pictures_TL = ft_timelockbaseline(cfg, erp_pictures);
erp_abstract_TL = ft_timelockbaseline(cfg, erp_abstract);
cfgp=[];
cfgp.interactive = 'yes';
cfgp.layout = 'easycapM11.mat';
cfgp.box='yes';
cfgp.showoutline = 'yes';

ft_multiplotER(cfgp, erp_pictures_TL,erp_abstract_TL.

When I run the last line of code, I get the following error:
[cid:image001.png at 01D21D6A.13970950]

I believe the problem is that erp_abstract.time and erp_picture.time are of different lengths (please see the picture below). We have sampled the data at 1000 Hz and each trial is approx. 8 seconds long (trial lengths vary from 7989 to 8012 points). To circumvent the problem, I tried an additional constraint on the accepted trials (accept only those that are exactly 8000 points) but that did not solve the problem. What am I doing wrong?

[cid:image002.png at 01D21D6A.13970950]

--
Tarkeshwar Singh
Postdoctoral Scholar
Department of Health Sciences and Research
Medical University of South Carolina
77 President Street, Room C305
Charleston, SC 29425
singht at musc.edu<mailto:hertzfel at musc.edu>







-------------------------------------------------------------------------
This message was secured via TLS by MUSC.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161003/2f239526/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 22130 bytes
Desc: image001.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161003/2f239526/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 77227 bytes
Desc: image002.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20161003/2f239526/attachment-0001.png>


More information about the fieldtrip mailing list