[FieldTrip] ft redefine trials: how to change trigger?

Max Cantor mcantor at umich.edu
Tue May 27 21:05:17 CEST 2014


Ya, it would definitely help if we could see your code, but I might have
another idea.

When you say you have a fixation cross trigger, is this trigger being
recorded from your EEG recording equipment in such a way that it can be
represented as an event value in cfg.trialdef for ft_definetrial? If so, I
think you may be right that it can't be changed through ft_redefinetrial
(at least, as far as I can tell, no mention of this is made in the help
section of the function). That being said, if you run ft_definetrial
separately for both event values that should work.

That being said, I may still be slightly confused about what you mean when
you say you want to change the trigger. Do you mean you want to create a
new trigger for your data off-line? I think it may be possible to create
custom triggers off-line through fieldtrip, but it's not something I've
tried personally, but if that is what you are trying to do, I could look
into it.


On Tue, May 27, 2014 at 2:44 PM, kousik sarathy <sarathykousik at gmail.com>wrote:

> Hey Katrin,
>
> It seems to me that Max's suggestion would suffice. But you seem to be
> looking for something else. Could you elaborate a little bit as to what you
> need?
>
> --
> Regards,
> Kousik Sarathy, S
>
>
>
> On Tue, May 27, 2014 at 8:30 PM, KatrinH Heimann <katrinheimann at gmail.com>wrote:
>
>> Dear Max, thanks a lot for your prompt answer. Unfortunately this is not
>> what I am looking for (I found an example like this in the tutorial). I
>> would like to change the trigger for one of the two conditions, let it be
>> now the response of the subject, as this is where the stimulus actually
>> starts... Defining two different timewindows is not enough... Can you also
>> help me with that? Thanks a million! Katrin
>>
>>
>> 2014-05-27 18:58 GMT+02:00 Max Cantor <mcantor at umich.edu>:
>>
>> Hi Katrin,
>>>
>>> It may help to see your code, but hopefully this will help. It should be
>>> as simple as taking your epoched data from ft_definetrial and
>>> ft_preprocessing, then creating two configurations for your timewindows and
>>> running ft_redefinetrial.
>>>
>>> For example (from the fieldtrip tutorial, slightly simplified by me for
>>> explanatory purposes):
>>>
>>> ***
>>>
>>> % find the interesting segments of data
>>>
>>> cfg                             = [];
>>>                    % empty configuration
>>> cfg.dataset                 = 'Subject01.ds';
>>>          % name of CTF dataset
>>> cfg.trialdef.eventtype    = 'backpanel trigger';
>>> cfg.trialdef.prestim       = 1;
>>> cfg.trialdef.poststim     = 2;
>>> cfg.trialdef.eventvalue   = 3;
>>>             % event value of FIC
>>> cfg                             = ft_definetrial(cfg);
>>>
>>> % preprocess the data
>>>
>>> cfg.channel                 = {'MEG'};
>>> dataFIC                      = ft_preprocessing(cfg);
>>>
>>> % define time window
>>>
>>> cfg                            = [];
>>>
>>> cfg.toilim                   = [-0.5 0];
>>> dataPre                     = ft_redefinetrial(cfg, dataFIC);
>>>
>>> cfg.toilim                   = [0.8 1.3];
>>> dataPost                   = ft_redefinetrial(cfg, dataFIC);
>>>
>>> ***
>>>
>>> So if your code resembles this, you are defining in cfg.trialdef.prestim
>>> and cfg.trialdef.poststim a timewindow that encompasses both your baseline
>>> period and stimulus period, then for cfg.toilim in the ft_redefinetrial
>>> section you are setting one to your baseline period and the other to your
>>> stimulus period, and outputting them into separate variables.
>>>
>>> Hopefully this helps. Also, if you haven't done so already, I would
>>> strongly recommend you run through the tutorial, as it may help answer
>>> questions like this in the future (assuming I've properly identified the
>>> issue).
>>>
>>> Good luck,
>>>
>>> Max
>>>
>>>
>>>
>>>
>>> On Tue, May 27, 2014 at 12:10 PM, KatrinH Heimann <
>>> katrinheimann at gmail.com> wrote:
>>>
>>>> Dear all,
>>>>
>>>> my name is Katrin Heimann, I am phd student at the University of Parma.
>>>> New to Fieldtrip.
>>>> I am doing an EEG analysis, still in the preprocessing phase.
>>>> It is a within trials design. I would like to compare a baseline period
>>>> with an experimental condition (visual stimulus).
>>>>
>>>>  I have a trigger after a fixation cross, then a baseline period
>>>> (approx 1 sec) , then the period of my stimulus (1 sec- starting with a
>>>> bottom press (trigger)).
>>>>
>>>>  As I would like to apply the same baseline correction for both (the
>>>> fixationcross period)  I planned to first define my trials as long trials
>>>> including the timewindows of baseline and the stimulus period, applying
>>>> filter and baselinecorrection on those long pieces. However, as I do not
>>>> wanna do the artifact detection on the whole pieces (but seperately for
>>>> baseline and stimulus, to avoid that I have to throw away too many trials)
>>>> I would like to redefine my trials then, cutting out only baseline period
>>>> and only stimulus period (starting with another trigger
>>>> (triggervalue=resp)..
>>>>
>>>> *Unfortunately I do not understand how I can change the trigger used
>>>> with ft redefine trial. *
>>>>
>>>> Anybody who could give me an example how that is done?
>>>> Thanks a million
>>>> Katrin
>>>>
>>>> _______________________________________________
>>>> fieldtrip mailing list
>>>> fieldtrip at donders.ru.nl
>>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>>
>>>
>>>
>>>
>>> --
>>> Max Cantor
>>> Research Assistant
>>> Computational Neurolinguistics Lab
>>> University of Michigan
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>>
>>
>>
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>>
>
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>



-- 
Max Cantor
Research Assistant
Computational Neurolinguistics Lab
University of Michigan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20140527/bd5a78ce/attachment-0002.html>


More information about the fieldtrip mailing list