-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modifications to make the demo ERP analysis work
- Loading branch information
1 parent
c85772c
commit 6bfcebf
Showing
41 changed files
with
878 additions
and
524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
function [toe, idx]= marker_mapping_SposRneg(desc) | ||
%MARKER_MAPPING_SPOSRNEG - Map BV Markers to numeric values | ||
% | ||
%Synopsis: | ||
% [TOE, IDX]= marker_mapping_SposRneg(DESC) | ||
% | ||
%Arguments: | ||
% DESC - Cell of strings: BV markers, like {'S 23', 'R134'} | ||
% | ||
%Output: | ||
% TOE - Numeric representation of the type of event. S-markers are mapped | ||
% to positive and R-markers to negative values | ||
% IDX - Indices of mapped markers (non-S/R markers are discarded) | ||
|
||
% 03-2011 Benjamin Blankertz | ||
|
||
|
||
iS= strmatch('S', desc); | ||
iR= strmatch('R', desc); | ||
toe= zeros(size(desc)); | ||
toe(iS)= cellfun(@(x)(str2double(x(2:end))), desc(iS)); | ||
toe(iR)= -cellfun(@(x)(str2double(x(2:end))), desc(iR)); | ||
idx= find(toe); | ||
toe= toe(idx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
function oldstate= bbci_typechecking(onoff) | ||
%BBCI_TYPECHECKING - Switch type checking on or off | ||
% | ||
%Synopsis: | ||
% bbci_typechecking(<SWITCH>) | ||
% OLD_STATE= bbci_typechecking(<SWITCH>) | ||
% | ||
%Arguments: | ||
% SWITCH: CHAR|BOOL - may be 'on'/1 (default) or 'off'/0 | ||
% | ||
%Returns: | ||
% OLD_STATE: CHAR - State ('on'/'off') that type checking had before | ||
% | ||
%Example: | ||
% tcstate= bbci_typechecking('off'); | ||
% % do time-critical things | ||
% bbci_typechecking(tcstat); | ||
|
||
|
||
global BBCI_TYPECHECKING | ||
|
||
oldstate= BBCI_TYPECHECKING; | ||
|
||
if nargin==0, | ||
onoff= 'on'; | ||
end | ||
|
||
BBCI_TYPECHECKING= onoff; | ||
|
||
switch(BBCI_TYPECHECKING), | ||
case {1, 'on'}, | ||
BBCI_TYPECHECKING= 1; | ||
case {0, 'off'}, | ||
BBCI_TYPECHECKING= 0; | ||
otherwise | ||
error('only ''on'' and ''off'' are allowed arguments'); | ||
end | ||
|
||
if nargout==0, | ||
clear oldstate; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
function cmap= cmap_bluewhite(m, varargin) | ||
%CMAP_BLUEWHITE - Colormap going from blue to white | ||
% | ||
%Usage: | ||
% MAP= cmap_bluewhite(M, <OPT>) | ||
% | ||
%Input: | ||
% M : Size of the colormap (number of entries). Default value: Same size | ||
% as current colormap | ||
% OPT: Struct or property/value list of optinal properties: | ||
% 'MinSat': minimal saturation (HSV model) from which fading is started | ||
% 'MinVal': minimal value (in HSV model) from which fading is started | ||
% | ||
%Output: | ||
% MAP: A colormap matrix of size [M 3] | ||
% | ||
%Example: | ||
% clf; | ||
% colormap(cmap_bluewhite(15)); | ||
% imagesc(toeplitz(1:15)); colorbar; | ||
% | ||
%See also COLORMAP, HSV2RGB, CMAP_HSVFADE | ||
|
||
% 01-2005 Benjamin Blankertz | ||
|
||
props= {'MinSat', 0.25, 'DOUBLE[1]' | ||
'MinVal', 0, 'DOUBLE[1]'}; | ||
|
||
if nargin<1 | isempty(m), | ||
m= size(get(gcf,'colormap'),1); | ||
end | ||
|
||
opt= opt_proplistToStruct(varargin{:}); | ||
[opt, isdefault]= opt_setDefaults(opt, props); | ||
opt_checkProplist(opt, props); | ||
|
||
m1= floor(m/2); | ||
m2= m-m1; | ||
map1= cmap_hsvFade(m1+1, 4/6, 1, [opt.MinSat 1]); | ||
map2= cmap_hsvFade(m2+1, 4/6, [1 opt.MinVal], 1); | ||
|
||
cmap= [map1; map2(3:end,:)]; |
Oops, something went wrong.