📄 pop_epoch.m
字号:
% pop_epoch() - Convert a continuous EEG dataset to epoched data by extracting% data epochs time locked to the specified events. Calls epoch().% Usage:% >> OUTEEG = pop_epoch( EEG); % pop-up a data entry window% >> OUTEEG = pop_epoch( EEG, events, timelimits);% >> [OUTEEG, indices] = pop_epoch( EEG, typerange, timelimits, ...% 'key1', value1 ...);%% Graphic interface:% "Time-locking event type(s)" - [edit box] Select 'Edit > Event values' % to see type values or use the push button. epoch() % function command line equivalent: 'typerange' % "..." - [push button] scroll event types.% "Epoch limits" - [edit box] time range [start, end] in seconds.% epoch() equivalent: 'timelim' % "Name for the new dataset" - [edit box] epoch() equivalent: 'newname'% "Out-of-bounds EEG ..." - [edit box] Rejection limits ([min max], []=none).% epoch() equivalent: 'valuelim' %% Inputs:% EEG - Input dataset. Data may already be epoched. In this case,% extract (shorter) subepochs time locked to epoch events.% typerange - Cell array of event types to time lock to.% {} --> all types of events. Note: An event field % called 'type' must be defined in the 'EEG.event' structure.% timelim - Epoch limits [start end] in seconds relative to the% time-locking event {Default: [-1 2]}%% Optional inputs:% 'valuelim' - [min max] Lower and upper bounds for trial data. If one % positive value is given, use its negative as the lower bound. % The given values are also considered outliers. {Default: none}% 'verbose' - ['yes'|'no']. {Default: 'yes'}% 'newname' - [string] New dataset name {Default: "[old_dataset] epochs"}% 'eventindices'- [indices] Extract data epochs time locked to the indexed events. % 'epochinfo'- ['yes'|'no']. Propagate event information into the new% epoch structure. {Default: 'yes'}% % Outputs:% OUTEEG - output dataset% indices - indices of accepted events%% Authors: Arnaud Delorme and Hilit Serby, SCCN, INC, UCSD, 2001%% See also: eeglab(), epoch() % deprecated% 'timeunit' - Time unit ['seconds'|'points'] If 'seconds,' consider events % times to be in seconds. If 'points,' consider events as% indices into the data array. {Default: 'points'}%123456789012345678901234567890123456789012345678901234567890123456789012% Copyright (C) 2001 Arnaud Delorme, Salk Institute, arno@salk.edu%% This program is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 2 of the License, or% (at your option) any later version.%% This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.%% You should have received a copy of the GNU General Public License% along with this program; if not, write to the Free Software% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA% $Log: pop_epoch.m,v $% Revision 1.42 2004/06/19 01:08:42 arno% first look at event latency problem%% Revision 1.41 2004/06/18 20:10:25 arno% default epoch range%% Revision 1.40 2004/06/16 22:21:03 arno% new GUI%% Revision 1.39 2004/05/14 23:56:29 arno% remove debug msg%% Revision 1.38 2004/04/07 02:02:07 arno% same%% Revision 1.37 2004/04/07 01:16:29 arno% resorting events%% Revision 1.36 2003/11/18 16:30:18 scott% same%% Revision 1.35 2003/11/18 16:29:31 scott% Enter ... -> ...%% Revision 1.34 2003/08/19 22:07:12 arno% automatically adding time-locking events if non%% Revision 1.33 2003/03/05 01:07:26 arno% no error if types is "[]"%% Revision 1.32 2003/02/23 09:16:09 scott% header edits -sm%% Revision 1.31 2003/02/17 02:40:14 arno% reformating text for new functionality in help2html%% Revision 1.30 2003/02/16 22:53:02 arno% update header for gui info%% Revision 1.29 2002/11/12 00:15:03 arno% updating header%% Revision 1.28 2002/11/12 00:08:26 arno% debugging eventindices%% Revision 1.27 2002/11/10 02:48:01 arno% debugging g.eventindices%% Revision 1.26 2002/09/23 23:36:04 arno% same%% Revision 1.25 2002/09/23 23:35:29 arno% debug lat%% Revision 1.24 2002/09/23 23:22:44 arno% cle[A%% display message%% Revision 1.23 2002/09/23 23:06:10 arno% debugging limits%% Revision 1.22 2002/09/04 22:26:03 luca% removing EEG.epoch mistmatch error message -arno%% Revision 1.21 2002/08/19 22:22:55 arno% default output var%% Revision 1.20 2002/08/17 20:07:22 scott% help message%% Revision 1.19 2002/08/17 19:53:02 scott% Epoch [min,max] -> Epoch limits [min,max]% ,%% Revision 1.18 2002/08/14 18:50:53 arno% same%% Revision 1.17 2002/08/14 18:41:37 arno% edit text%% Revision 1.16 2002/08/14 17:46:18 arno% debuging%% Revision 1.15 2002/08/13 21:27:41 arno% debug%% Revision 1.14 2002/08/12 16:28:13 arno% inputdlg2%% Revision 1.13 2002/08/08 21:56:30 arno% removing epoch creation%% Revision 1.12 2002/08/08 14:46:30 arno% programming boundary events%% Revision 1.11 2002/08/06 21:35:13 arno% spelling%% Revision 1.10 2002/07/21 17:17:15 arno% debugging extract epochs from epochs%% Revision 1.9 2002/06/28 02:15:37 arno% considering events in different epochs%% Revision 1.8 2002/06/25 00:50:17 arno% debugging several event selection%% Revision 1.7 2002/06/25 00:46:39 arno% adding eventconsistency check%% Revision 1.6 2002/06/25 00:38:03 arno% sort event in ascending time before epoching%% Revision 1.5 2002/04/26 20:16:09 arno% debugging epoch extraction from integer types%% Revision 1.4 2002/04/20 00:13:13 arno% correcting latency computation bug%% Revision 1.3 2002/04/11 22:28:54 arno% adding new dataset name%% Revision 1.2 2002/04/10 02:42:22 arno% debuging event selection%% Revision 1.1 2002/04/05 17:32:13 jorn% Initial revision%% 01-25-02 reformated help & license -ad % 02-13-02 introduction of 'key', val arguments -ad% 02-13-02 rereferencing of events -ad% 03-18-02 interface and debugging -ad% 03-27-02 interface and debugging -ad & smfunction [EEG, indices, com] = pop_epoch( EEG, events, lim, varargin );if nargin < 1 help pop_epoch; return;end; com = '';indices = [];if isempty(EEG.event) if EEG.trials > 1 & EEG.xmin <= 0 & EEG.xmax >=0 disp('No event found: creating events of type ''TLE'' (Time-Locking Event) at time 0'); EEG.event(EEG.trials).epoch = EEG.trials; for trial = 1:EEG.trials EEG.event(trial).epoc = trial; EEG.event(trial).type = 'TLE';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -