Skip to content

Commit

Permalink
Stage v8.01
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewxstewart committed Jun 13, 2020
1 parent 0d1e553 commit 31429c2
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erplab_default_values.m
@@ -1,5 +1,5 @@
erplabver = '8.0'; % current erplab version
erplabrel = '29-Apr-2020'; % DOB
erplabver = '8.01'; % current erplab version
erplabrel = '12-Jun-2020'; % DOB
%ColorB = [170 180 195]/255; % old background color (until version 3)
%ColorB = [0.9216 0.8353 0.6078]; % background color for version 4
%ColorB = [0.7020 0.7647 0.8392]; % background color since version 4.0.0.3
Expand Down
135 changes: 135 additions & 0 deletions functions/show_events_here.m
@@ -0,0 +1,135 @@
% PURPOSE : Summarizes current EEG event codes into MATLAB command window
%
% FORMAT :
%
% show_events_here(EEG)
%
% EXAMPLE :
%
% show_events_here(EEG)
%
% INPUTS :
%
% EEG - EEG structure
%
% OUTPUTS
%
% -Summary of EEG event codes in command window
%
% *** This function is part of ERPLAB Toolbox ***
% Author: Javier Lopez-Calderon
% Center for Mind and Brain
% University of California, Davis,
% Davis, CA
% 2009
%
% show_events_here is a reworking of pop_squeezevents
%
%b8d3721ed219e65100184c6b95db209bb8d3721ed219e65100184c6b95db209b
%
% ERPLAB Toolbox
% Copyright © 2007 The Regents of the University of California
% Created by Javier Lopez-Calderon and Steven Luck
% Center for Mind and Brain, University of California, Davis,
% javlopez@ucdavis.edu, sjluck@ucdavis.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 3 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, see <http://www.gnu.org/licenses/>.
%
function [EEG, com] = show_events_here(EEG, varargin)
com = '';
if isobject(EEG) % eegobj
whenEEGisanObject % calls a script for showing an error window
return
end
if isempty(EEG(1))
msgboxText = 'show_events_here() cannot work with an empty dataset.';
title = 'ERPLAB: show_events_here Permission denied';
errorfound(msgboxText, title);
return
end
if ~isempty(EEG(1).epoch)
msgboxText = 'show_events_here() has been tested for continuous data only.';
title = 'ERPLAB: show_events_here Permission denied';
errorfound(msgboxText, title);
return
end
if isempty(EEG(1).data)
msgboxText = 'show_events_here() cannot work with an empty dataset.';
title = 'ERPLAB: show_events_here Permission denied';
errorfound(msgboxText, title);
return
end
if isempty(EEG(1).event)
msgboxText = 'show_events_here() cannot work with an empty dataset.';
title = 'ERPLAB: show_events_here Permission denied';
errorfound(msgboxText, title);
return
end
if isempty([EEG(1).event.type])
msgboxText = 'show_events_here() cannot work with an empty dataset.';
title = 'ERPLAB: show_events_here Permission denied';
errorfound(msgboxText, title);
return
end

p = inputParser;
p.FunctionName = mfilename;
p.CaseSensitive = false;
p.addRequired('EEG');
p.addParamValue('History', 'script', @ischar); % history from scripting
p.parse(EEG, varargin{:});

if strcmpi(p.Results.History,'implicit')
shist = 3; % implicit
elseif strcmpi(p.Results.History,'script')
shist = 2; % script
elseif strcmpi(p.Results.History,'gui')
shist = 1; % gui
else
shist = 0; % off
end

%
% process multiple datasets April 13, 2011 JLC
%
if length(EEG) > 1
[EEG, com ] = eeg_eval( 'show_events_here', EEG, 'warning', 'on');
return;
end

squeezevents(EEG.event);
com = sprintf( 'show_events_here(%s);', inputname(1));

% get history from script. EEG
switch shist
case 1 % from GUI
com = sprintf('%s %% GUI: %s', com, datestr(now));
%fprintf('%%Equivalent command:\n%s\n\n', com);
displayEquiComERP(com);
case 2 % from script
EEG = erphistory(EEG, [], com, 1);
case 3
% implicit
% EEG = erphistory(EEG, [], com, 1);
% fprintf('%%Equivalent command:\n%s\n\n', com);
otherwise %off or none
com = '';
return
end

%
% Completion statement
%
msg2end
return

0 comments on commit 31429c2

Please sign in to comment.