[FieldTrip] redefining data set
Martin Rosenfelder
martin.rosenfelder at uni-ulm.de
Mon Jan 14 18:29:12 CET 2019
Dear Fieldtrip community,
I have preprocessed a single dataset with two different conditions ('Swim', 'Rest'). The conditions are stored in the 'eventvalue' field of the cfg as 1x2 cell array. The event values are stored in the 'data_ref.cfg.previous.previous.previous{1,1}.previous.previous.trialdef.eventvalue' field of the data set.
Having done the preprocessing I now would like to do ft_timelockanalysis and ft_freqanalysis on the data. Afterwards I statistically compare the two conditions using ft_timelockstatistics and ft_freqstatistics.
How can I split the data set according to the event values ('Swim', 'Rest')? I need the event values to split the data set into the two trial classes in the ft_timelockanalysis / ft_freqanalysis and to compare these two conditions.
I tried ft_redefinetrial, but do not know how to define the cfg.trials field of this function.
% trial redefinition
% containing only trials in the 'swim' condition
cfg.trials = (1, data_ref.cfg.previous.previous.previous{1,1}.previous.previous.trialdef.eventvalue(1,1));
swim = ft_redefinetrial(cfg,data_ref);
% containing only trials in the 'resting' condition
cfg.trials = (1, data_ref.cfg.previous.previous.previous{1,1}.previous.previous.trialdef.eventvalue(1,2));
rest = ft_redefinetrial(cfg,data_ref);
I hope the description was quite clear. In case, I can provide some more lines of code to clarify the issue.
Thank you very much in advance for your advice!
Best regards,
Martin
--
M.Sc.-Psych. Martin Rosenfelder
Wissenschaftlicher Mitarbeiter
Klinische und Biologische Psychologie
Universität Ulm
Raum 47.2.259
+49 731-50 26592
martin.rosenfelder at uni-ulm.de
More information about the fieldtrip
mailing list