<html><head><base href="x-msg://32/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Nicolas<div><br></div><div>That is a good suggestion, I have incorporated it into the code. This evenings version on the ftp server will include it.</div><div><br></div><div>thanks,</div><div>Robert</div><div><br><div>
<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-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; "><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; "><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; "><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><div>-----------------------------------------------------------<br>Robert Oostenveld, PhD<br>Senior Researcher<br>Donders Institute for Brain, Cognition and Behaviour<br>Centre for Cognitive Neuroimaging<br>Radboud University Nijmegen<br>tel.: +31 (0)24 3619695<br>e-mail: <a href="mailto:r.oostenveld@donders.ru.nl">r.oostenveld@donders.ru.nl</a><br>web: <a href="http://www.ru.nl/neuroimaging">http://www.ru.nl/neuroimaging</a><br>skype: r.oostenveld<br>-----------------------------------------------------------<br></div></div></div></span></div></span></div></span></span>
</div>
<br><div><div>On 27 Feb 2010, at 14:55, Nicolas Robitaille wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; 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 class="hmmessage" style="font-size: 10pt; font-family: Verdana; ">Dear Karl, dear Robert,<br><br>I would suggest, alternatively, to modify the trialfun_general (or wathever trialfun you are using, Karl), in order to use the event definition found in the cfg structure, if any. This would have the advantage of allowing multiple call to definetrial (for multiple conditions; I once had 30 of them) without having to read all the events in the datafile over and over again. I think such change in behavior could be incorporated in the normal distribution of FT, according that it's already the case of the trial definition (i.e. if there is already a .trl field, definetrial.m just use it).<span class="Apple-converted-space"> </span><br><br>This would look like:<br><br><b>starting at line 49 of trialfun_general:</b><br><br>% read the header and event information<br>hdr = read_header(cfg.headerfile);<br>try<br>  event = read_event(cfg.headerfile);<br>catch<br>  event = [];<br>end<br><br><b>should become something like:</b><br><br>% read the header and event information<br>hdr = read_header(cfg.headerfile);<br>if isfield(cfg, 'event')<br>  event = cfg.event;<br>  else<br>try<br>  event = read_event(cfg.headerfile);<br>catch<br>  event = [];<br>end<br>end<br><br>Karl, note that I haven't test that.<span class="Apple-converted-space"> </span><br><br>Best,<br><br>Nicolas<br><br>*************************<br>Nicolas Robitaille, Ph.D.<br>Stagiaire post-doctoral<br>Brams<br>*************************<br><br><br><br><br>> Date: Sat, 27 Feb 2010 14:21:03 +0100<br>> From:<span class="Apple-converted-space"> </span><a href="mailto:r.oostenveld@FCDONDERS.RU.NL">r.oostenveld@FCDONDERS.RU.NL</a><br>> Subject: Re: [FIELDTRIP] read events<br>> To:<span class="Apple-converted-space"> </span><a href="mailto:FIELDTRIP@NIC.SURFNET.NL">FIELDTRIP@NIC.SURFNET.NL</a><br>><span class="Apple-converted-space"> </span><br>> Dear Karl,<br>><span class="Apple-converted-space"> </span><br>> Definetrial is usually called before preprocessing, not after preprocessing. Definetrial determines the trial structure, i.e. the segments that subsequently are read with the preprocessing function. Often the interesting data segments (the trials) are much shorter than the complete continuous data, so reading only the trials saves memory.<br>><span class="Apple-converted-space"> </span><br>> Since you have already read in all data into memory, you should use "redefinetrial" to segment your data into the trials. That also requires the trial definition to be specified in cfg.trl. The only purpose of definetrial function is t oconstruct this cfg.trl field based on the events.<span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> Since you manually added the triggers after reading the data in memory, you have to emulate the behaviour of definetrial. You should look at it's help and manually construct a cfg.trl field which you can hand over to redefinetrial together with the data.<br>><span class="Apple-converted-space"> </span><br>> best,<br>> Robert<br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> On 25 Feb 2010, at 18:35, Karl Doron wrote:<br>><span class="Apple-converted-space"> </span><br>> > My apologies if this is redundant - I believe I sent to it the megcommunity<br>> > list and meant to send it here, so I am reposting.<br>> ><span class="Apple-converted-space"> </span><br>> > Hello,<br>> ><span class="Apple-converted-space"> </span><br>> > I've recently collect MEG data and had to edit trigger values. I've read in<br>> > my BTi data using preprocessing() and inserted triggers at appropriate times<br>> > in sub1.trial{1}(1,:).<br>> ><span class="Apple-converted-space"> </span><br>> > Now I would like to use definetrial. However, the cfg file references the<br>> > original data, with the incorrect trigger onsets and information. What<br>> > should I list as cfg.dataset to have my imported data read?<br>> ><span class="Apple-converted-space"> </span><br>> > Thanks for any help.<br>> ><span class="Apple-converted-space"> </span><br>> > karl doron<br>> > Ph.D. Candidate<br>> > UC, Santa Barbara<br>> ><span class="Apple-converted-space"> </span><br>> > ----------------------------------<br>> > The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also<span class="Apple-converted-space"> </span><a href="http://listserv.surfnet.nl/archives/fieldtrip.html">http://listserv.surfnet.nl/archives/fieldtrip.html</a><span class="Apple-converted-space"> </span>and<a href="http://www.ru.nl/neuroimaging/fieldtrip">http://www.ru.nl/neuroimaging/fieldtrip</a>.<br>> ><span class="Apple-converted-space"> </span><br>><span class="Apple-converted-space"> </span><br>> ----------------------------------<br>> The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also<span class="Apple-converted-space"> </span><a href="http://listserv.surfnet.nl/archives/fieldtrip.html">http://listserv.surfnet.nl/archives/fieldtrip.html</a><span class="Apple-converted-space"> </span>and<a href="http://www.ru.nl/neuroimaging/fieldtrip">http://www.ru.nl/neuroimaging/fieldtrip</a>.<br><br><hr>Vous n'utilisez pas Hotmail sur votre téléphone? Mais pourquoi pas?<span class="Apple-converted-space"> </span><a href="http://go.microsoft.com/?linkid=9708126" target="_new">Obtenez-le maintenant!</a><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">----------------------------------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">The aim of this list is to facilitate the discussion between users of the FieldTrip toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://listserv.surfnet.nl/archives/fieldtrip.html">http://listserv.surfnet.nl/archives/fieldtrip.html</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.ru.nl/fcdonders/fieldtrip/">http://www.ru.nl/fcdonders/fieldtrip/</a></div></div></span></blockquote></div><br></div></body></html><p>----------------------------------</p>
<p>The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis.</p>
<p>  http://listserv.surfnet.nl/archives/fieldtrip.html</p>
<p>  http://www.ru.nl/fcdonders/fieldtrip/</p>