7 % biosigevent - BioSig
event structure
8 % interval - Period to extract events
for, in frames.
12 % eeglabevent - EEGLAB
event structure
14 % Author: Arnaud Delorme, SCCN, INC, UCSD, 2006-
16 % Copyright (C) 13 2006- Arnaud Delorme, Salk Institute, arno@salk.edu
18 % This program is free software; you can redistribute it and/or modify
19 % it under the terms of the GNU General Public License as published by
20 % the Free Software Foundation; either version 2 of the License, or
21 % (at your option) any later version.
23 % This program is distributed in the hope that it will be useful,
24 % but WITHOUT ANY WARRANTY; without even the implied warranty of
25 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 % GNU General Public License
for more details.
28 % You should have received a copy of the GNU General Public License
29 % along with
this program;
if not, write to the Free Software
30 % Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 disp(
'Importing data events...');
41 % If the interval variable is empty,
import all events.
43 if isfield(EVENT,
'Teeg')
46 if isfield(EVENT, 'TYP')
47 for index = 1:length( EVENT.TYP )
48 event(index).type = EVENT.TYP(index);
51 if isfield(EVENT, 'POS')
52 for index = 1:length( EVENT.POS )
53 event(index).latency = EVENT.POS(index);
56 if isfield(EVENT, 'DUR')
57 if any( [ EVENT.DUR ] )
58 for index = 1:length( EVENT.DUR )
59 event(index).duration = EVENT.DUR(index);
63 if isfield(EVENT, 'CHN')
64 if any( [ EVENT.CHN ] )
65 for index = 1:length( EVENT.CHN )
66 event(index).chanindex = EVENT.CHN(index);
70 % If a subinterval was specified, select only events that fall in that range, and
71 % edit duration field if it exceeds that range.
72 elseif isfield(EVENT,'POS')
74 for index = 1:length(EVENT.POS)
75 pos_tmp = EVENT.POS(index) - interval(1) + 1;
76 if pos_tmp > 0 & EVENT.POS(index) <= interval(2)
77 event(count).latency = pos_tmp;
78 if isfield(EVENT, 'TYP'), event(count).type = EVENT.TYP(index); end
79 if isfield(EVENT, 'CHN'), event(count).chanindex = EVENT.CHN(index); end
80 if isfield(EVENT, 'DUR')
81 event(count).duration = min(EVENT.DUR(index), interval(2) - EVENT.POS(index));