[FieldTrip] Reject bad trials

Caspar, Emilie e.caspar at ucl.ac.uk
Thu Aug 28 08:45:32 CEST 2014


Hello,

I'm preprocessing my EEG data. The script works correctly, but I think there is something wrong, when I look at the output.
I reject bad trials with :

cfg             = [];
cfg.alim        = 100;
cfg.keepchannel = 'yes';
cfg.layout      = 'biosemi64.lay';
% cfg.method      = 'summary';
% cfg.method      = 'trial';
cfg.method      = 'channel'; %% Or 'trial'
cfg.metric      = 'var';
[data_clean]    = ft_rejectvisual(cfg, epData);
cfg.artfctdef.reject = 'complete';
cfg.artfctdef.feedback = 'yes';


And apparently, Fieldtrip correctly identifies what the trials to reject are, Matlab indicates:

91 trials marked as GOOD, 9 trials marked as BAD
66 channels marked as GOOD, 0 channels marked as BAD
the following trials were removed: 13, 23, 32, 42, 58, 59, 61, 95, 99
the call to "ft_rejectvisual" took 27 seconds and required the additional allocation of an estimated NaN MB

So I save this file, before averaging with :
avgFC = ft_timelockanalysis(cfg, epData);
ft_singleplotER(cfg,avgFC);


What is strange, is that during the averaging, I can see that in my matlab window that the averaging is on 100 trials (= the basic number of trials, without rejection), as if Fieldtrip did not take into account the bad trials in the averaging.

averaging trials
averaging trial 100 of 100


By reading, I though that maybe it was because of this function that was missing into my script :
cleandata = ft_rejectartifact(cfg,'epData');


However, I have the following mistake, and I don't understand it:
Error using ft_rejectartifact (line 234)
no trials were selected, cannot perform artifact detection/rejection

Error in preprocessing_Libet (line 274)
cleandata = ft_rejectartifact(cfg,'epData');



Can someone help?


Thank you in advance,

Emilie




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140828/fe4e7353/attachment.html>


More information about the fieldtrip mailing list