[FieldTrip] Single trial baseline correction in ft_preprocessing

Stephen Whitmarsh stephen.whitmarsh at gmail.com
Tue Sep 17 22:45:05 CEST 2019


Hi Duru,

Use cfg.trials = trial_index
Put the output in a struct, i.e. bl{trial_index}
Then combine with ft_append_data([],bl{:});

Hope this helps,
Stephen


On Tue, 17 Sep 2019, 19:30 Duru Gun Ozkan, <durugun.ozkan at uniroma1.it>
wrote:

> Hi everyone,
>
> I have a question regarding specifying a different baseline correction
> time for each trial in ft_preprocessing.
> I had 360 audio stimuli all of which had different lengths. My trigger is
> located at the end of each stimuli, and I would like to place the baseline
> correction between 200 ms before stimulus start and stimulus start.
> I have a matrix for cfg.baselinewindow called BaselineWindow such as this:
> -1.83018 -1.630182
> -1.69807 -1.498071
> -0.58653 -0.38653
> -1.07604 -0.876039
> -2.2608 -2.060803
> -0.80863 -0.608632
> -1.55663 -1.356629
> -0.94261 -0.742605
> -1.20845 -1.008448 ...
> I tried to create a loop:
>
> for trial_index = 1:360
>
>      cfg = [];
>      cfg.demean        = 'yes';
>      cfg.baselinewindow = [BaselineWindow(trial_index,1)
> BaselineWindow(trial_index,2)];
>
>      data_baselined_end_E = ft_preprocessing(cfg, data_end_E);
>
>  end
>
> This didn't work because it kept running the preprocessing with all the
> baselines with all trials, instead of keeping to its specific trial.
>
> My question is, is there another way to specify individual baselines for
> individual trials? Or can anyone suggest to improve this loop to have the
> data preprocessed with its specific baseline windows?
>
> Thank you in advance.
>
> Best,
>
> Duru
>
> --
> *Duru G**ü**n **Ö**zkan*
>
>
> *Ph.D. student in Cognitive Social and Affective Neuroscience.*
>
>
> *Department of Psychology.University of Rome "La Sapienza".Via dei Marsi
> 78 - 00185 - Roma.*
>  *e-mail: durugun.ozkan at uniroma1.it <vanessa.era at uniroma1.it>*
> *https://agliotilab.org/lab-staff/phd-students/2nd-year#anchor
> <https://agliotilab.org/lab-staff/phd-students/2nd-year#anchor>*
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190917/e53c5591/attachment.html>


More information about the fieldtrip mailing list