[FieldTrip] using ft_definetrial
Pelt, S. van (Stan)
stan.vanpelt at donders.ru.nl
Tue Jul 14 09:24:34 CEST 2015
Hi Nikola,
You might also try a workaround:
% read the events from the data
event = ft_read_event('C:\eeg_anita\data\S14\s14_CI_1.cnt');
% search for "trigger" events
triggers=[];
for i=1:size(event,1)
a=find(strcmp(event(i).type,'trigger')==1);
if a>0
triggers=[triggers; event(i).value event(i).sample];
end
end
% make cfg.trl: I think this is where things go wrong in your script. You could check what’s in triggers(:,1). Otherwise, what’s below should work:
u1=find(ismember(triggers(:,1),[1 3 6 9])); % select your eventvalue(s) of interest
trl= [triggers(u1,2)-.2*fs triggers(u1,2)+6*fs repmat(-.2*fs,numel(u1),1)]; % 0.2 prestim, 6s post-stim, with fs being your sampling frequency
% next, do preprocessing, with cfg.trl=trl;
From: fieldtrip-bounces at science.ru.nl [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Jörn M. Horschig
Sent: dinsdag 14 juli 2015 8:38
To: 'FieldTrip discussion list'
Subject: Re: [FieldTrip] using ft_definetrial
Hi Nikola,
seems to be a nasty problem. I’d start with using event = ft_read_events(cfg.dataset) and then check up the event-structure on how they are defined there. ft_trialfun_general is literally checking that event-structure, so defining them like they are specified in there might help.
Best,
Jörn
--
Jörn M. Horschig, PhD, Software Engineer
Artinis Medical Systems<http://www.artinis.com/> | +31 481 350 980
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Nikola Valchev
Sent: Monday, July 13, 2015 9:51 PM
To: 'FieldTrip discussion list'
Subject: Re: [FieldTrip] using ft_definetrial
Nope. That’s not it. No matter if I declare it as a double or string when I call the eventtype ‘trigger’ instead of ‘?’ they are not read.
Nikola
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [mailto:fieldtrip-bounces at science.ru.nl] On Behalf Of Pelt, S. van (Stan)
Sent: 13 July 2015 19:30
To: FieldTrip discussion list
Subject: Re: [FieldTrip] using ft_definetrial
What about
cfg.trialdef.eventvalue = 1;
Op 13 jul. 2015, om 18:36 heeft Eelke Spaak <eelke.spaak at donders.ru.nl<mailto:eelke.spaak at donders.ru.nl>> het volgende geschreven:
cfg.trialdef.eventvalue = {'1'};
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150714/5a1cb788/attachment-0002.html>
More information about the fieldtrip
mailing list