[FieldTrip] Still Reading a Trigger Channel
jan-mathijs schoffelen
jan.schoffelen at donders.ru.nl
Fri Mar 11 11:49:29 CET 2011
Dear Ivano,
I would first check what 'triggers' fieldtrip automatically detects
from your data. As far as I am aware, there is no default reading of a
'trigger' channel for .edf data, but I am not sure.
You can get an idea bout the event-info, by specifying
cfg = [];
cfg.dataset = ...
cfg.trialdef.eventtyp = '?';
ft_definetrial(cfg);
This outputs some info to your screen, about which events are in the
data. Each event is of a certain type 'type' , and may have a value
'value', e.g. when the acquisition system has an explicit trigger
channel to which your stimulus presentation program, or response
device sends discrete trigger pulses of varying height.
In your case, I suspect that something else needs to be done (in case
definetrial does not show triggers related to your trigger channel),
i.e. you need to write your own 'trialfun'. Rather than using
cfg.trialdef.eventtype/eventvalue, you need to specify cfg.trialfun =
'ivanoscooltrialfun', and you need to write your own file:
trialfun_ivanoscooltrialfun which defines your segments of interest
based on some feature in your trigger channel. Here's an example which
uses an EMG-channel as epoch-defining signal. Of course your trigger
channel needs to be processed in a different way but at least it gives
you an impression.
http://fieldtrip.fcdonders.nl/example/detect_the_muscle_activity_in_an_emg_channel_and_use_that_as_trial_definition?s
[]=trialfun
Good luck
Jan-Mathijs
On Mar 11, 2011, at 10:37 AM, Ivano Triggiani wrote:
> Dear Eelke,
>
> thanks for the aswer. but I'm not sure what does it mean for
> 'value' ? Value of what? Order of comparison, value of voltage of
> wave, or what?
> I have this trigger channel and I have 120 triggers... I want to
> evaluate my EEG 2 seconds prestim, 2 seconds poststim for every
> trigger!
> And when I use eventtype "TRIGGER" (yes, it is labelled so), It ask
> me for a trialfun... and told me it have found 201 events (they were
> just 120...)
> Ivano
>
> -------------------------------------------------------
>
> Hi Ivano,
>
> The cfg.trialdef.eventtype and cfg.trialdef.eventvalue are used by the
> so-called "trialfun", a function that selects interesting pieces of
> the data (i.e., trials). If you do not explicitly specify a trialfun
> (with cfg.trialfun = 'mytrialfun'), ft_definetrial will by default use
> 'trialfun_general'. This default function looks in the channel
> specified by cfg.trialdef.eventtype for values equal to the
> cfg.trialdef.eventvalue you specified. So, in your case (assuming your
> trigger channel is indeed labelled 'TRIGGER'), you would use something
> like:
>
> cfg.trialdef.eventtype = 'TRIGGER';
> cfg.trialdef.eventvalue = 1; % (or whatever is the value in your
> trigger channel that corresponds to the trigger you are interested in)
>
> Note that you can get an overview of the event channels present in
> your data, along with their possible values, by executing:
>
> cfg = [];
> cfg.trialdef.eventtype = '?';
> cfg.dataset = 'mydataset.edf';
> ft_definetrial(cfg);
>
> Hope this helps.
>
> Best,
> Eelke
>
> 2011/3/9 Ivano Triggiani <ivano_triggiani at yahoo.it>:
> > Hi,
> >
> > I'm a new user and I don't understand how to read from a specific
> channel my
> > event. Basically I have a .edf file with 25 EEG channel (they are
> all
> > sampled at the same f) and the 25th one is my TRIGGER (a simple
> square
> > wave). What must I do to read from that channel ?
> > What is my cfg.trialdef.eventtype ? And my cfg.trialdef.eventvalue?
> > (I've read all documentation about it)
> > Thanks a lot,
> > Ivano
> >
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
Dr. J.M. (Jan-Mathijs) Schoffelen
Donders Institute for Brain, Cognition and Behaviour,
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands
J.Schoffelen at donders.ru.nl
Telephone: 0031-24-3614793
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20110311/23003a50/attachment-0001.html>
More information about the fieldtrip
mailing list