[FieldTrip] Question about ft_definetrials

justyna marie justyna_marie at yahoo.com
Wed Feb 15 22:13:52 CET 2017


Dear community members,
I am new to Fieldtrip therefore would very much appreciate your advice on the following:I have been trying to convert my pre-processed and segmented EEG data from eeglab .set format to Fieldtrip to perform some analyses. My data contains epochs marked by 5 types of trigger values ('3','4','5','6','7'). 
I used:
mydata = eeglab2fieldtrip (EEG, 'preprocessing');

to convert between data formats and then build condition corresponding to my markers  with cfg.trialdef structure but unfortunately I keep getting the following message:
Error using ft_definetrial (line 188)no trials were defined, see FT_DEFINETRIAL for help
I then tried to define the trial structure with the following script:
eventValues = {'3','4','5','6','7'};prepost = [0.2 1.7];ftype = 'eeglab_set';data = struct;for evVal = 1:length(eventValues)    infile = fullfile(strcat('D:\Exp_8\EEG_analyses\filename', [eventValues{evVal}],'.set'));    cfg = [];    cfg.dataset = infile;    cfg.headerfile = infile;    cfg.dataformat = ftype;    cfg.headerformat = ftype;       cfg.continuous = 'no';    cfg.trialdef.prestim = prepost(1);    cfg.trialdef.poststim = prepost(2);    cfg.trialfun = 'ft_trialfun_general';    cfg.trialdef.eventtype = 'Trigger';    cfg.trialdef.eventvalue = eventValues{evVal};    cfg = ft_definetrial(cfg);    data.(eventValues{evVal}) = ft_preprocessing(cfg);end

but I am getting exactly the same error...
Any suggestions of likely mistakes of my part/ problem with script would be most helpful.
Many thanks,
Justyna 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170215/34c990f8/attachment-0001.html>


More information about the fieldtrip mailing list