[FieldTrip] Reject bad trials

Caspar, Emilie e.caspar at ucl.ac.uk
Thu Aug 28 10:02:35 CEST 2014


Dear Elke,

Thank you for this suggestion. So I have changed following your suggestion :
clean_data = ft_rejectartifact(cfg,epData);

89 trials marked as GOOD, 11 trials marked as BAD
66 channels marked as GOOD, 0 channels marked as BAD
the following trials were removed: 13, 24, 29, 32, 51, 59, 61, 68, 86, 95, 99

avgFC = ft_timelockanalysis(cfg, clean_data);

However, still the same problem : the averaging is always on the 100 trials.
the input is raw data with 66 channels and 100 trials
averaging trials
averaging trial 100 of 100

Emilie

--------

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

avgFC = ft_timelockanalysis(cfg, clean_data);
ft_singleplotER(cfg,avgFC);




---------------------------------------------
Emilie Caspar

Aspirante FNRS - Ph.D. Student

Consciousness, Cognition & Computation Group (CO3)
Centre de Recherche Cognition et Neurosciences (CRCN)
ULB Neurosciences Institute (UNI)

Université Libre de Bruxelles
Av. F.-D. Roosevelt, 50
1050 Bruxelles
BELGIUM

Voice : +32 2 650 32 95
mail : ecaspar at ulb.ac.be<mailto:ecaspar at ulb.ac.be>
office: DB10-138




Le 28 août 2014 à 09:23, "Caspar, Emilie" <e.caspar at ucl.ac.uk<mailto:e.caspar at ucl.ac.uk>>
 a écrit :

Hi,

Thank you for the answer. Indeed, I have no mistake anymore in the script.

However, my basic problem is still there :  I reject bad trials, but the averaging is on the 100 trials

Any ideas?

Emilie

Le 28 août 2014 à 09:07, Tyler Grummett <tyler.grummett at flinders.edu.au<mailto:tyler.grummett at flinders.edu.au>>
 a écrit :

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
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

_______________________________________________
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/0a6886d7/attachment-0002.html>


More information about the fieldtrip mailing list