[Eeglablist] Problem with non-epoched binlisted events
Camilo Quezada
cequezad at uc.cl
Thu Jun 13 10:14:16 PDT 2013
Hi:
I am new to EEGLAB and I encountered a problem while trying to generate a
script for MATLAB that invokes both EEGLAB and ERPLAB. Being this a problem
mainly concerned with ERPLAB, I am not sure this list is the proper channel
to ask for suggestions, but here it goes anyway.
With quite a deal of help, I finally generated the following script, which
by the way works fine:
for ni=1:2%3
dir_root = ['Ins' num2str(ni)];
for nb=1% número del bloque a analizar
filename_list = dir(fullfile(dtdir, dir_root, ['Bloque '
num2str(nb)], '*.bdf'));
% load
EEG = pop_readbdf(fullfile(dtdir, dir_root, ['Bloque '
num2str(nb)], filename_list(1).name), [1 622], 41, [37 38]);
EEG = eeg_checkset( EEG );
% channel location
EEG=pop_chanedit(EEG, 'lookup','C:\\Program
Files\\MATLAB\\R2008a\\eeglab11_0_4_3b\\plugins\\dipfit2.2\\standard_BESA\\standard-10-5-cap385.elp');
% remove cardio
EEG = pop_select( EEG,'nochannel',{'EXG7' 'EXG8'});
% filter
EEG = pop_eegfilt( EEG, 0.5, 30, [], [0], 0, 0, 'fir1', 0);
% BSS
EEG = pop_autobsseog( EEG, [622], [622], 'sobi', {'eigratio',
[1000000]}, 'eog_fd', {'range',[2 8]});
% rereference
EEG = pop_reref( EEG, [37 38] );
% remove ocular channels
EEG = pop_select( EEG,'nochannel',{'EXG1' 'EXG2' 'EXG3' 'EXG4'});
% set name
EEG.setname = [dir_root '_b' num2str(nb)];
% create event list
EEG = pop_creabasiceventlist( EEG , 'Eventlist', 'elist.txt',
'Newboundary', { -99 }, 'Stringboundary', { 'boundary' }, 'Warning', 'on' );
% binlister
EEG = pop_binlister( EEG, 'BDF', binlist, 'ExportEL',
[fullfile(bindir,'binlogs_') EEG.setname '.txt'], 'UpdateEEG', 'on',
'Warning', 'on');
% epoch data
EEG = pop_epochbin( EEG , epoch, 'pre');
% artifact removal
EEG = pop_artmwppth( EEG , 'Channel', 1:32, 'Flag', 1,
'Threshold', 150, 'Twindow', [ 0 600], 'Windowsize', 200, 'Windowstep', 100
)
% save .set
EEG = pop_saveset( EEG, 'filename', [EEG.setname '.set'],
'filepath', wkdir);
% pop average
ERP = pop_averager( EEG , 'Criterion', 'good', 'Stdev', 'on' );
% save as ERP
erpname = [EEG.setname '_ERPs']; % name for erpset menu
fname_erp = fullfile(wkdir2, [erpname '.erp']);
pop_savemyerp(ERP, 'erpname', erpname, 'filename', fname_erp);
end
end
I tested with two continuous sets of raw data (.bdf files) and everything
works fine with the first set (60 trials are epoched), but the second one
consistently ends up with 55 epochs instead of the 60 epochs specified in
the bin file. I checked the binfile and it´s ok, I inspected the .pcl file
(I programmed the experiment in Presentation) and it´s ok too.
I checked the binlog output, took notice of the bins that were not found
when generating the bin structure and identified the code events that were
missing. Then I inspected the original raw .bdf file and I found out, that,
for no reason that I can tell, the last 15 or so events are just missing in
the binlog output. This includes the five targets I need to be epoched.
Also, there is no visible reason for this happens, that is, in the .bdf
file there is no large gap o sudden burst or whatever between the last
event actually binned and the next one in the continuous data.
My conclusion is that the bin structure process stops some 15 to 20 trials
BEFORE the actual end of the continuous data file.
I am completely clueless about the reason for this. I thought it might have
something to do with the artifact removal and/or flagging, but this step is
programmed to happen AFTER the bin list structure generation and therefore
should affect the binlist generation (even less the binlist output).
By the way, I am using EEGLAB 11_04_3b and erplab 3.0.2.1. I will deeply
appreciate any help and I apologize if this particular issue has been
discussed and/or solved before.
Cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20130613/ca14d49d/attachment.html>
More information about the eeglablist
mailing list