[FieldTrip] Question about ft_definetrials

anne Hauswald anne.hauswald at me.com
Thu Feb 16 09:05:28 CET 2017


Hi Justyna, 

I just scanned your code, but just to be sure: did you check your event type with fieldtrip?

For my EEG data e.g. the event type is ‚Stimulus‘.
You can check it with the following code
cfg = [];
cfg.dataset            = 'yourfile.ext';
cfg.trialdef.eventtype = '?';
ft_definetrial(cfg);
(http://www.fieldtriptoolbox.org/faq/how_can_i_find_out_what_eventvalues_and_eventtypes_there_are_in_my_data)

Best Anne




> Am 15.02.2017 um 22:13 schrieb justyna marie <justyna_marie at yahoo.com>:
> 
> 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
>  
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip

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


More information about the fieldtrip mailing list