[FieldTrip] Just a small question about resegmenting epoched data...
catia barbosa
catia_barbosa at live.fr
Mon Mar 2 09:29:15 CET 2015
Dear
community,
I'll start
by thanking you for spending your time trying to answer my question. I'm having
some trouble with my script. I have filter and do my ICA rejection in my
epoched data already. But know I'm thinking, that it would be more interesting
and efficient to do it in a more segmented data. But I don't want to waste time
redoing all the preprocessing all over again. So I resegmented the already
epoched data in many subepochs. Even so I'm not satisfied, I would like to know
if there is a simple and elegant way of doing it in fieldtrip, better than mine
(here above):
SOA = 390;
BL = 500;
sr = 678.17;
SOA = round(SOA*sr/1000);
BL = round(BL*sr/1000);
adjust_sample=[0 1 1 2 2 3 3 4 4 5 5 6 6]; %adjusting for rounding SOA
%constructing begsample and endsample
beg_begspl = BL;
end_begspl = SOA*12 + BL;
begsample = [beg_begspl:SOA:end_begspl];
begsample=begsample+adjust_sample;
beg_endspl = SOA*4 + BL;
end_endspl = SOA*16 + BL;
endsample = [beg_endspl:SOA:end_endspl];
endsample = endsample + adjust_sample;
cte = (endsample(1)- begsample(1))/2;
%creating new epochs
cfg = [];
cfg.begsample = begsample(1);
cfg.endsample = endsample(1);
tmp_data1= ft_redefinetrial(cfg, data);
cfg = [];
cfg.offset = [-(0*SOA)-(cte)];
tmp_data1 = ft_redefinetrial(cfg, tmp_data1);
....
cfg = [];
cfg.begsample = begsample(13);
cfg.endsample = endsample(13);
tmp_data13= ft_redefinetrial(cfg, data);
cfg = [];
cfg.offset = [-(12*SOA)-(cte)];
tmp_data13 = ft_redefinetrial(cfg, tmp_data13);
%concatenating data
cfg = [];
tmp_data = ft_appenddata(cfg, tmp_data1, tmp_data2, tmp_data3,
tmp_data4, tmp_data5, tmp_data6, tmp_data7, tmp_data8, tmp_data9 , tmp_data10, tmp_data11,
tmp_data12, tmp_data13);
Once again, thank you
Barbosa Catia
INSERM U 1106 /Institut de neurosciences des
systèmes (FRANCE)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150302/13eefde4/attachment.html>
More information about the fieldtrip
mailing list