<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Ivano,<div><br></div><div>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.</div><div><br></div><div>You can get an idea bout the event-info, by specifying</div><div><br></div><div>cfg = [];</div><div>cfg.dataset = ...</div><div>cfg.trialdef.eventtyp = '?';</div><div>ft_definetrial(cfg);</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div><a href="http://fieldtrip.fcdonders.nl/example/detect_the_muscle_activity_in_an_emg_channel_and_use_that_as_trial_definition?s">http://fieldtrip.fcdonders.nl/example/detect_the_muscle_activity_in_an_emg_channel_and_use_that_as_trial_definition?s</a>[]=trialfun</div><div><br></div><div>Good luck</div><div><br></div><div>Jan-Mathijs</div><div><br><div><div>On Mar 11, 2011, at 10:37 AM, Ivano Triggiani wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-family: arial, helvetica, sans-serif; font-size: 10pt; ">Dear Eelke,<br><br>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?<span class="Apple-converted-space"> </span><br>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!<br>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...)<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Ivano<br> <br>-------------------------------------------------------<br><br>Hi Ivano,<br><br>The cfg.trialdef.eventtype and cfg.trialdef.eventvalue are used by the<br>so-called "trialfun", a function that selects interesting pieces of<br>the data (i.e., trials). If you do not explicitly specify a trialfun<br>(with cfg.trialfun = 'mytrialfun'), ft_definetrial will by default use<br>'trialfun_general'. This default function looks in the channel<br>specified by cfg.trialdef.eventtype for values equal to the<br>cfg.trialdef.eventvalue you specified. So, in your case (assuming your<br>trigger channel is indeed labelled 'TRIGGER'), you would use something<br>like:<br><br>cfg.trialdef.eventtype = 'TRIGGER';<br>cfg.trialdef.eventvalue = 1; % (or whatever is the value in your<br>trigger channel that corresponds to the trigger you are interested in)<br><br>Note that you can get an overview of the event channels present in<br>your data, along with their possible values, by executing:<br><br>cfg = [];<br>cfg.trialdef.eventtype = '?';<br>cfg.dataset = 'mydataset.edf';<br>ft_definetrial(cfg);<br><br>Hope this helps.<br><br>Best,<br>Eelke<br><br>2011/3/9 Ivano Triggiani <<a href="mailto:ivano_triggiani@yahoo.it">ivano_triggiani@yahoo.it</a>>:<br>> Hi,<br>><br>> I'm a new user and I don't understand how to read from a specific channel my<br>> event. Basically I have a .edf file with 25 EEG channel (they are all<br>> sampled at the same f) and the 25th one is my TRIGGER (a simple square<br>> wave). What must I do to read from that channel ?<br>> What is my cfg.trialdef.eventtype ? And my cfg.trialdef.eventvalue?<br>> (I've read all documentation about it)<br>> Thanks a lot,<br>> Ivano<br>><br></div></div><br>_______________________________________________<br>fieldtrip mailing list<br><a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br><a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Dr. J.M. (Jan-Mathijs) Schoffelen </div><div>Donders Institute for Brain, Cognition and Behaviour, <br>Centre for Cognitive Neuroimaging,<br>Radboud University Nijmegen, The Netherlands</div><div><a href="mailto:J.Schoffelen@donders.ru.nl">J.Schoffelen@donders.ru.nl</a></div><div>Telephone: 0031-24-3614793</div></div></span></div></span> </div><br></div></body></html>