<div dir="ltr">Hi Arjen,<div><br></div><div>I had a feeling it would involve creating my own trial function, which is something I've never done but have looked over in the past, so I'll give that a shot, thanks!</div><div><br></div><div>As for your suggested loop... I had tried something almost like that, except preprocessing the data first and then using ft_redefinetrial, and then concatenating them all with ft_appenddata. However, What I ended up realizing was that the .trl array was only being retained from one of the 8 sessions, which was creating problems with artifact rejection since the artifact rejection functions use the sample points from .trl. Are you suggesting that if I had used ft_definetrial and then that configuration in ft_preprocessing, rather than what I did, that it would have concatenated .trl for all sessions? If this is not the case, and either way should work, maybe I did something else wrong, or misdiagnosed the problem altogether...</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 10, 2016 at 5:18 PM, Arjen Stolk <span dir="ltr"><<a href="mailto:a.stolk8@gmail.com" target="_blank">a.stolk8@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I see now you wrote 8 sessions with the same subject. You could make a loop that conceptually looks like this:<div><br></div><div>for s = 1:numsessions</div><div><br></div><div>cfg = ft_definetrial(cfg);</div><div>data{s} = ft_preprocessing(cfg);<br></div><div><br></div><div>end</div><div>data_all = ft_appenddata([], data{:});</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-02-10 16:15 GMT-08:00 Arjen Stolk <span dir="ltr"><<a href="mailto:a.stolk8@gmail.com" target="_blank">a.stolk8@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Max,<div><br></div><div>See these pages and judge for yourself:</div><div><a href="http://www.fieldtriptoolbox.org/example/getting_started_with_reading_raw_eeg_or_meg_data" target="_blank">http://www.fieldtriptoolbox.org/example/getting_started_with_reading_raw_eeg_or_meg_data</a><br></div><div><a href="http://www.fieldtriptoolbox.org/example/making_your_own_trialfun_for_conditional_trial_definition" target="_blank">http://www.fieldtriptoolbox.org/example/making_your_own_trialfun_for_conditional_trial_definition</a><br></div><div><br></div><div>If your trials are defined as x1 time before a certain trigger until x2 time after, it's very easy. If it's slightly more complicated, then check that second page. In short, the idea there is to make ft_definetrial call a tailormade trial function (cfg.trialfun). The good news is that if the triggers and trials are the same for each subject, you only have to make one function.</div><div><br></div><div>Hope that gets you started,</div><div>Arjen</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>2016-02-10 16:03 GMT-08:00 Max Cantor <span dir="ltr"><<a href="mailto:Max.Cantor@colorado.edu" target="_blank">Max.Cantor@colorado.edu</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hi fieldtrip community,<div><br></div><div>I'm trying to use ft_definetrial to create a trial definition from 8 datasets, recorded back-to-back from a subject, and then use ft_redefinetrial with that trial definition and raw data that was concatenated in eeglab and converted to a fieldtrip structure using eeglab2fieldtrip. Is this feasible in a relatively straightforward way, or would I be better off doing the epoching in eeglab as well before converting back to fieldtrip?<br><br>On a side note, I chose to concatenate the data in eeglab because I could not figure out a convenient way to do so in fieldtrip. I know there is ft_appenddata, but as best as I can tell this is meant to be used after epoching, and the sample information was not being concatenated (or at least not properly), which was creating problems down the line with artifact rejection in my pipeline. Maybe there was some other way to do this properly in fieldtrip that I had not considered in the first place.</div><div><br></div><div>Best,</div><div><br></div><div>Max</div><span><font color="#888888"><div><div><br></div>-- <br><div><div dir="ltr"><div style="font-size:small"><div>Max Cantor<br></div>Graduate Student</div><div style="font-size:small">Cognitive Neuroscience of Language Lab</div><span style="font-size:small">University of Colorado Boulder</span><br></div></div>
</div></font></span></div>
<br></div></div>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div style="font-size:small"><div>Max Cantor<br></div>Graduate Student</div><div style="font-size:small">Cognitive Neuroscience of Language Lab</div><span style="font-size:small">University of Colorado Boulder</span><br></div></div>
</div>