[FieldTrip] two events per trial

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Tue May 10 20:43:41 CEST 2016


Hi Cecile,

This sounds like a quasi serious flaw in your experimental setup. In general I would advice against the definition of the same event code for different events. In case one (or more) triggers are lost upon collection, it will be not trivial to correctly reconstruct the events post-hoc (in which case you always need to rely on an extra source of data , e.g. a logfile written out by your stimulus presentation software, where you then have to assume that all went well).
Anyway, after this pedagogical note, the only thing I could come up with, is to write a custom ‘trialfun’ for your purposes, which selects every second equally valued event to be the ‘begin-of-trial’ trigger.

Best,
Jan-Mathijs

On 10 May 2016, at 18:16, Cecile Issard <cecile.issard at etu.parisdescartes.fr<mailto:cecile.issard at etu.parisdescartes.fr>> wrote:

Hi Tineke,

My problem is that the triggers for the onset and the offset of the stimulus are the same…

—
Message: 6
Date: Tue, 10 May 2016 08:55:39 +0000
From: "Snijders, T.M. (Tineke)" <tineke.snijders at donders.ru.nl<mailto:tineke.snijders at donders.ru.nl>>
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] two events per trial ?
Message-ID:
<815A9820E75FBC4F96B7CD3A8089D11C378BF25F at exprd04.hosting.ru.nl<mailto:815A9820E75FBC4F96B7CD3A8089D11C378BF25F at exprd04.hosting.ru.nl>>
Content-Type: text/plain; charset="Windows-1252"

Hi Cecile,

One option is to run ft_definetrial two times.

First you specify only your onset triggers as cfg.trialdef.eventvalue, with the correct cfg.trialdef.prestim, and a random cfg.trialdef.poststim (e.g. 1).
Then you run
cfg_begin=ft_definetrial(cfg)
This gives you cfg_begin.trl which specifies the onset sample points of the trial in the first column, and the offset sample points of the trial in the second column (e.g. 1 second later, but you'll overwrite this later).

Now you specify only your offset triggers as cfg.trialdef.eventvalue, with cfg.trialdef.prestim=0.
You run:
cfg_offset=ft_definetrial(cfg)
This gives you cfg_offset.trl, with the first column being the offset sample points in your data.

Now you make your final trl, in which you replace the second column of cfg_begin with the first one of cfg_offset

trl=cfg_begin.trl;
for i=1:size(cfg_offset.trl)
  trl(i,2)=cfg_offset.trl(i,1);
end

For ft_preprocessing you then give cfg.trl=trl.

Best,
Tineke




________________________________________
From: fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl> [fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>] on behalf of Cecile Issard [cecile.issard at etu.parisdescartes.fr<mailto:cecile.issard at etu.parisdescartes.fr>]
Sent: Sunday, May 08, 2016 11:30 PM
To: fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>
Subject: [FieldTrip] two events per trial ?

Hello,

How can I specify that I have two events per trial (one for the onset and one for the offset of the stimulus) so that ft_definetrial finds the right (two times less) number of trials ?

Best,

C?cile

?
C?cile Issard
PhD student
Laboratoire Psychologie de la Perception
CNRS UMR8242 - Universit? Paris Descartes
45 rue des Saints-P?res
75006 Paris
Cécile Issard
Doctorante
01.42.86.43.20
Laboratoire Psychologie de la Perception - UMR8242
45 rue des Sts Pères
75270 Paris cedex 06
http://lpp.psycho.univ-paris5.fr/index.php
Labo bébé : http://recherche.parisdescartes.fr/LBB



_______________________________________________
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/20160510/df5f6573/attachment-0002.html>


More information about the fieldtrip mailing list