[FieldTrip] define trials from multiple datasets
Max Cantor
Max.Cantor at Colorado.EDU
Thu Feb 11 01:52:30 CET 2016
Hi Arjen,
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!
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...
On Wed, Feb 10, 2016 at 5:18 PM, Arjen Stolk <a.stolk8 at gmail.com> wrote:
> I see now you wrote 8 sessions with the same subject. You could make a
> loop that conceptually looks like this:
>
> for s = 1:numsessions
>
> cfg = ft_definetrial(cfg);
> data{s} = ft_preprocessing(cfg);
>
> end
> data_all = ft_appenddata([], data{:});
>
> 2016-02-10 16:15 GMT-08:00 Arjen Stolk <a.stolk8 at gmail.com>:
>
>> Hi Max,
>>
>> See these pages and judge for yourself:
>>
>> http://www.fieldtriptoolbox.org/example/getting_started_with_reading_raw_eeg_or_meg_data
>>
>> http://www.fieldtriptoolbox.org/example/making_your_own_trialfun_for_conditional_trial_definition
>>
>> 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.
>>
>> Hope that gets you started,
>> Arjen
>>
>> 2016-02-10 16:03 GMT-08:00 Max Cantor <Max.Cantor at colorado.edu>:
>>
>>> Hi fieldtrip community,
>>>
>>> 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?
>>>
>>> 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.
>>>
>>> Best,
>>>
>>> Max
>>>
>>> --
>>> Max Cantor
>>> Graduate Student
>>> Cognitive Neuroscience of Language Lab
>>> University of Colorado Boulder
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>
>>
>>
>
--
Max Cantor
Graduate Student
Cognitive Neuroscience of Language Lab
University of Colorado Boulder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20160210/8bcd46b5/attachment-0002.html>
More information about the fieldtrip
mailing list