[FieldTrip] Single trial baseline correction in ft_preprocessing

Duru Gun Ozkan durugun.ozkan at uniroma1.it
Tue Sep 17 19:27:10 CEST 2019

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)

     data_baselined_end_E = ft_preprocessing(cfg, data_end_E);


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.



*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>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190917/334066eb/attachment.html>

More information about the fieldtrip mailing list