[FieldTrip] Baseline correction when epoching after filtering

Snijders, T.M. (Tineke) tineke.snijders at donders.ru.nl
Mon Jun 27 11:13:47 CEST 2016


Hi Emil,

You can just use ft_preprocessing on the redefined data, to do baseline-correction only.

So after:
data   = ft_redefinetrial(cfg_cond);

you do:
cfg=[];
cfg.demean='yes';
cfg.baselinewindow=[-2 0];
dataBL=ft_preprocessing(cfg,data);

Cheers,
Tineke



________________________________________
From: fieldtrip-bounces at science.ru.nl [fieldtrip-bounces at science.ru.nl] on behalf of Emil Østergård Johansen [emilj at drcmr.dk]
Sent: Monday, June 27, 2016 10:53 AM
To: fieldtrip at science.ru.nl
Subject: [FieldTrip] Baseline correction when epoching after filtering

Dear all,
I cannot figure out how to subtract a baseline window in each trial, say [-2.0 0] when using ft_redefinetrial to epoch my data.
As far as I can see baseline correction is only an option for ft_preprocessing.
My pipeline is as follows:
1) Run ICA on data which is preprocessed in a manner specifically for ICA
2) Apply ICA weights to raw data (after this my data is in .mat format)
3) Reref and filter using ft_preprocessing
4) Epoch data using ft_definetrial and ft_redefinetrial

The code for epoching is as follows and works fine:

cfg.dataset = [cfg.subjectdir cfg.subjectstr '.bdf’]; % Raw data for defining trials
cfg_cond    = ft_definetrial(cfg);
cfg_cond.inputfile   = [cfg.subjectdir cfg.subjectstr '_ICApruned_filtered.mat’];
data   = ft_redefinetrial(cfg_cond);

I want to subtract the baseline window when epoching (and epoching should be done after filtering to minimize filter artifacts).
I tried using ft_preprocessing again to both subtract baseline and epoch the data (instead of ft_redefinetrial):

cfg.dataset = [cfg.subjectdir cfg.subjectstr '.bdf’]; % Raw data for defining trials
cfg_cond    = ft_definetrial(cfg);
cfg_cond.inputfile   = [cfg.subjectdir cfg.subjectstr '_ICApruned_filtered.mat’];
cfg_cond.demean = 'yes';
cfg_cond.baselinewindow = [-2.0 0];
data = ft_preprocessing(cfg_cond);

but got: "Warning: The field cfg.trl is forbidden, it will be removed from your configuration” and no trials were created.

You might suggest that I include the cfg.demean in step 3 when filtering, but then I am unsure if it will simply demean the entire dataset using the same value since the data is continuous at that point.
If it is of importance I have my own trial function

Thank you for your time,
Emil Johansen
Hvidovre University Hospital
Denmark
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip




More information about the fieldtrip mailing list