-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathconfigureDemo.m
More file actions
118 lines (107 loc) · 4.1 KB
/
configureDemo.m
File metadata and controls
118 lines (107 loc) · 4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
% guard to prevent running slow path-setup etc. multiple times
if ( ~exist('configRun','var') || isempty(configRun) )
% setup the paths
% search for the location of the buffer_bci root
mfiledir=fileparts(mfilename('fullpath'));
bufferdir=mfiledir(1:strfind(mfiledir,'buffer_bci')+numel('buffer_dir'));
if ( exist(fullfile(bufferdir,'utilities/initPaths.m')) ) % in utilities
run(fullfile(bufferdir,'utilities','initPaths.m'));
else % or matlab/utilities?
run(fullfile(bufferdir,'matlab','utilities','initPaths.m'));
end
buffhost='localhost';buffport=1972;
% wait for the buffer to return valid header information
hdr=[];
while ( isempty(hdr) || ~isstruct(hdr) || (isfield(hdr,'nchans') && hdr.nchans==0) ) % wait for the buffer to contain valid data
try
hdr=buffer('get_hdr',[],buffhost,buffport);
catch
hdr=[];
fprintf('Invalid header info... waiting.\n');
end;
pause(1);
end;
% set the real-time-clock to use
initgetwTime;
initsleepSec;
if ( exist('OCTAVE_VERSION','builtin') )
page_output_immediately(1); % prevent buffering output
if ( ~isempty(strmatch('qthandles',available_graphics_toolkits())) )
graphics_toolkit('qthandles'); % use fast rendering library
elseif ( ~isempty(strmatch('fltk',available_graphics_toolkits())) )
graphics_toolkit('fltk'); % use fast rendering library
end
end
configRun=true;
end
%capFile='cap_tmsi_mobita_black';%'1010'; %'emotiv';%cap_tmsi_mobita_im2'; N.B. use 1010 for emotiv so non-eeg are labelled correctly
verb=0;
buffhost='localhost'; buffport=1972;
% Brain response parameters
stimDuration=.15;% the length a row/col is highlighted
interSeqDuration=2;
feedbackDuration=5;
stimRadius=.6;
ssvepFreq = [15 7.5 10 20 30];
isi=1/60;
flickerFreq=[15 20];
ersptrialDuration=8;
baselineDuration=2;
intertrialDuration=2;
ersptrlen_ms=1000;
% general cue color specifications
bgColor=[.2 .2 .2]; % background color (grey)
flashColor=[1 1 1]; % the 'flash' color (white)
tgtColor=[0 1 0]; % the target indication color (green)
fixColor=[1 0 0];
fbColor=[0 0 1]; % feedback color - (blue)
% PTB stuff
windowPos=[];%[0 0 500 500]; % in sub-window set to [] for full screen
% instructions object
instructstr={'Stimulus Type Keys',
'';
'1 or v : visual reponse',
'2 or o : visual oddball',
sprintf('3 or s : SSVEP (%ghz)',ssvepFreq(1)),
'4 or p : visual P300',
sprintf('5 or f : flicker (%g or %ghz)',flickerFreq(1),flickerFreq(2)),
'6 or l : left cue task',
'7 or n : no cue task',
'8 or r : right cue task',
'a : auditory oddball',
'q : quit'
};
% speller config options
spnSeq=20;
nPauseSeq=5;
nSeq=5;
spPauseInstruct={'Break Time!','','What do your brain responses look like?','','Click to continue'};
nRepetitions=5; % the number of complete row/col stimulus before sequence is finished
nTestRepetitions=10;% the number of complete row/col stim for test phase
cueDuration=2;
stimDuration=.15; % the length a row/col is highlighted
dataDuration=.6; % amount of data used for classifier
%interSeqDuration=2;
feedbackDuration=5;
% BODGE: class names in events: N.B. use +/- to indicate positive/negative classes
TARGETNAME='+ Target'; NONTARGETNAME='- Non-Target';
dv2flash=1; % multiplier for classifier output to convert to flash/non-flash if needed
% the set of options the user will pick from
symbols={'1' '2' '3';...
'4' '5' '6';...
'7' '8' '9'}';
spInstruct={'Concentrate on the Green Number.','And count the number of times','it flashes.','Click to begin'};
spTestInstruct={'Freely choose which response to look at','and count the flashses.','After the flashsing finishes','The BLUE symbol is what','the BCI thought','','Click to begin'};
tstSymbols={'yes' 'no' 'mabye'};
symbSize=.1;
sptrlen_ms=dataDuration*1000;
% IM config options
nSymbs=2;
imnSeq=30;
imtrialDuration=3;
baselineDuration=2;
intertrialDuration=2;
%feedbackDuration=1;
moveScale = .1;
imtrlen_ms = imtrialDuration*1000;
imInstruct={'Perform the task as indicated.','Green symbol is the target.','Blue symbol is the prediction','Click to begin.'};