<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Arti,
<div class=""><br class="">
</div>
<div class="">Have you read the help documentation of ft_redefinetrial? I think it should give you sufficient pointers about how to re-epoch your data. As far as I remember, it does not operate on an event structure in the input, but rather requires (for instance)
 a trl matrix that has been obtained with ft_definetrial (the latter function operates on an event structure, in combination with a recipe that specifies how to parse the events. This is known as a ‘trialfun', which is possibly of your own making, e.g. if you
 want to do fancy stuff with your events (e.g. conditional things: if event x was followed by event y within z ms of event q when there was a response half an hour ago then, the epoch should start when event t occurs within three minutes of … (you get the hang
 of it?)). Please consult <a href="http://www.fieldtriptoolbox.org/example/making_your_own_trialfun_for_conditional_trial_definition/" class="">http://www.fieldtriptoolbox.org/example/making_your_own_trialfun_for_conditional_trial_definition/</a>  for more
 information.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 27 Sep 2019, at 15:52, Arti Abhishek <<a href="mailto:mailtome.2113@gmail.com" class="">mailtome.2113@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div class=""><font face="arial, sans-serif" class="">Dear Jan-Mathijs,</font></div>
<div class=""><font face="arial, sans-serif" class=""><br class="">
</font></div>
<div class=""><font face="arial, sans-serif" class="">Thank you for your email. I had a look at the documentation for ft_redefinetrial and I am not sure where I  should give the event information? I haven't used ft_definetrial earlier in the processing pipeline.
 Does the event data structure (with fields <span style="" class="">type, value, sample, offset, duration) be given as cfg.trials in fr_redefinetrial?</span></font></div>
<div class=""><font face="arial, sans-serif" class=""><span style="" class=""><br class="">
</span></font></div>
<div class=""><font face="arial, sans-serif" class=""><span style="" class="">Thanks,</span></font></div>
<div class=""><font face="arial, sans-serif" class=""><span style="" class="">Arti</span></font></div>
<div dir="ltr" class=""><br class="">
</div>
<div dir="ltr" class="">Date: Wed, 25 Sep 2019 08:06:57 +0000<br class="">
From: "Schoffelen, J.M. (<span class="gmail-il">Jan</span> Mathijs)" <<a href="mailto:jan.schoffelen@donders.ru.nl" target="_blank" class=""><span class="gmail-il">jan</span>.schoffelen@donders.ru.nl</a>><br class="">
To: FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl" target="_blank" class="">fieldtrip@science.ru.nl</a>><br class="">
Subject: Re: [FieldTrip] Epoch using events from a different file<br class="">
Message-ID: <<a href="mailto:3512026C-F136-41FD-B03E-490BF8C7FBEF@donders.ru.nl" target="_blank" class="">3512026C-F136-41FD-B03E-490BF8C7FBEF@donders.ru.nl</a>><br class="">
Content-Type: text/plain; charset="us-ascii"<br class="">
<br class="">
If you want to re-epoch data that is already in a fieldtrip structure, you need to use ft_redefinetrial, rather than ft_definetrial. Please see the help documentation of the function, and the website for more information.<br class="">
<br class="">
Best wishes,<br class="">
<span class="gmail-il">Jan</span>-Mathijs<br class="">
</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Sep 25, 2019 at 5:25 PM Arti Abhishek <<a href="mailto:mailtome.2113@gmail.com" class="">mailtome.2113@gmail.com</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<div dir="ltr" class="">
<div dir="ltr" class="">Dear fieldtrip community,</div>
<div dir="ltr" class=""><br class="">
</div>
<div class="">I am really stuck on how to use ft_definetrial when the data and events are in seperate MATLAB strctures (both in fieldtrip format). Please see my original question below. Any help would be appreciated.</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Arti<br class="">
</div>
<br class="">
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Sun, Sep 22, 2019 at 11:44 PM Arti Abhishek <<a href="mailto:mailtome.2113@gmail.com" target="_blank" class="">mailtome.2113@gmail.com</a>> wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<div dir="ltr" class="">Dear field trip community,
<div class=""><br class="">
</div>
<div class="">I am trying to epoch an EEG dataset using events from a different  file (ie, events are not present in the EEG file). I have preprocessed the EEG and event information separately. The EEG data is in the fieldtript format with the following fields;</div>
<div class=""><br class="">
</div>
<div class="">hdr 1 x1 struct</div>
<div class="">label  64 x 1 cell</div>
<div class="">time 1 x 1 cell</div>
<div class="">trial 1 x 1 cell</div>
<div class=""><br class="">
</div>
<div class="">I want to epoch the data using the event data (also in fieldtrip compatible format) with fields</div>
<div class=""><br class="">
</div>
<div class="">type, value, sample, offset, duration.</div>
<div class=""><br class="">
</div>
<div class="">I couldn't find out how to do this. How do I  use ft_definetrial in this case? All my attempts haven't worked yet. I could't find any example in the website or in the discussion list. An example would be much appreciated.</div>
<div class=""><br class="">
</div>
<div class="">Kind regards,</div>
<div class="">Arti </div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>