[FieldTrip] Reject bad trials

Eelke Spaak eelke.spaak at donders.ru.nl
Thu Aug 28 09:18:35 CEST 2014


Hi Emilie,

It seems to me you are passing the non-cleaned data (epData) into
ft_timelockanalysis, and not the cleaned data (data_clean).

Best,
Eelke

On 28 August 2014 08:45, Caspar, Emilie <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
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip



More information about the fieldtrip mailing list