[FieldTrip] Baseline correction on TFR with baseline period in separate trial
mp95kexi at studserv.uni-leipzig.de
mp95kexi at studserv.uni-leipzig.de
Fri Mar 15 18:33:08 CET 2024
Hi Fieldtrippers!
I am quite new to fieldtrip and coding and would love some help and/or
suggestions. I am investigating brain mechanism behind binary
communication, more precisely I am trying to distinguish positive
answers from negative ones.
I have data from 3 patients and at the moment want to conduct a
between trial single subject comparison.
The paradigm of my data is generally :
Trigger S 10 or S 11: baseline period (5-10s) --- Trigger S5 or S6:
Question period (length varies) ---- Trigger S 4 or S 8: Thinking
period (10-15s)
I have preprocessed the data, defining trials at baseline triggers and
thinking triggers like this:
cfg = [];
cfg.dataset = vhdrFile;
cfg.trialfun = 'ft_trialfun_general';
cfg.trialdef.eventtype = 'Stimulus';
cfg.trialdef.eventvalue = {'S 4' 'S 8' 'S 10' 'S 11'};
% thinking trigger: S4 for yes answers, S8 for no,
% baseline trigger: S10 before yes question/answer, S11 for no
cfg.trialdef.prestim = 2;
cfg.trialdef.poststim = 5; % only first 3 seconds plus 2 sec padding
cfg = ft_definetrial(cfg);
cfg.continuous = 'yes';
cfg.channel = {'all'}; % only EEG
cfg.detrend = 'yes';
cfg.demean = 'yes';
cfg.reref = 'yes';
cfg.refchannel = 'all';
cfg.refmethod = 'avg';
cfg.bpfilter = 'yes';
cfg.bpfiltord = 3;
cfg.bpfilttype = 'but';
cfg.bpfreq = [0.5 45];
cfg.dftfilter = 'yes';
cfg.dftfreq = [50 100];
% save data in same location as its corresponding file
[~, fileName, ~] = fileparts(vhdrFile);
cfg.outputfile = fullfile(vhdrFiles(i).folder, [fileName, '_data']);
ft_preprocessing(cfg);
Next I did a TF decomposition, below are the settings I have used
cfg = [];
cfg.method = 'mtmconvol';
cfg.output = 'pow'; % return power-spectra
cfg.channel = 'all';
cfg.trials = 'all';
cfg.keeptrials = 'no'; % 'yes' for cluster based permuatation
test between trials, 'no' results in average
cfg.taper = 'hamming';
cfg.foi = 1:45;
cfg.t_ftimwin = ones(length(cfg.foi),1); % length of time window 1 sec
cfg.toi = -1:0.05:3;
cfg.trials = find(data.trialinfo(:,1) == 4);
tfdata_yes = ft_freqanalysis(cfg, data);
cfg.trials = find(data.trialinfo(:,1) == 8);
tfdata_no = ft_freqanalysis(cfg, data);
Now I want to dB baseline correct the thinking epochs (S4 and S8)
using the baseline epochs (S10 and S11). From what I could find
online, usually one would use pre-stimulus period for baseline
correction. With my data, the pre-stimulus period is inside the
question period hence why there is another baseline period before
that. I am quite confused on how to do this correctly.
I'd really appreciate any ideas on this,
Meedy
More information about the fieldtrip
mailing list