https://github.com/cathazi/Zich_2023_3DBursts
Raw File
Tip revision: e06ea92422ff5f8a5add2e52283f61e5236739a4 authored by cathazi on 04 April 2023, 12:29:39 UTC
Add files via upload
Tip revision: e06ea92
do_epoch.m
function D = do_epoch (D_cont,time_epoch,epoch)

% define epoch parameter
D_cont    = D_cont.montage('switch',D_cont.montage('getnumber'));
S.D       = D_cont;
S.timewin = [time_epoch(1) time_epoch(2)];

S.trialdef(1).conditionlabel = epoch.type;
S.trialdef(1).eventtype = epoch.type;
S.trialdef(1).eventvalue = epoch.value;
S.reviewtrials = 0;
S.save = 0;
S.epochinfo.padding = 0;
S.event = D_cont.events;
S.fsample = D_cont.fsample;
S.timeonset = D_cont.timeonset;
[epochinfo.trl,epochinfo.conditionlabels,~] = spm_eeg_definetrial(S);

% do epoching
S2        = epochinfo;
S2.D      = D_cont;
S2.prefix = epoch.sufix;
D         = osl_epoch(S2);
back to top