[FieldTrip] Reject bad trials
Tyler Grummett
tyler.grummett at flinders.edu.au
Thu Aug 28 09:07:36 CEST 2014
Hey Emilie,
If you remove the inverted commas from 'epData' on line:
cleandata = ft_rejectartifact(cfg,'epData');
So that it is:
cleandata = ft_rejectartifact(cfg,epData);
does that then work?
Tyler
Sent from my iPad
On 28 Aug 2014, at 4:18 pm, "Caspar, Emilie" <e.caspar at ucl.ac.uk<mailto:e.caspar at ucl.ac.uk>> wrote:
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
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140828/d6a57b51/attachment-0002.html>
More information about the fieldtrip
mailing list