-
Notifications
You must be signed in to change notification settings - Fork 2
/
a_load_all_data.m
53 lines (44 loc) · 1.25 KB
/
a_load_all_data.m
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
clear all;
startup_bbci_toolbox
%% Load Isolated data
BTB.DataDir = 'A:\Scientific_data\revision\MobileBCI_BIDS';
BTB.task = 'SSVEP'; %ERP, SSVEP
datatype = 'eeg';
%%
switch(BTB.task)
case 'SSVEP'
disp_ival= [0 5000]; % SSVEP
trig_sti = {11,12,13; '5.45','8.57','12'};
nSub = 23;
case 'ERP'
disp_ival= [-200 800]; % ERP
ref_ival= [-200 0] ;
trig_sti = {2,1 ;'target','non-target'};
nSub = 24;
end
%%
CNT = [];
MRK = [];
EPO = [];
MNT = [];
for subNum = 1:nSub
fprintf('Load Subject %02d ...\n',subNum)
for sesNum = 1:5
sub_dire = sprintf('sub-%02d/ses-%02d',subNum,sesNum);
% sub-01_task-ERP_speed-0.8_scalp-EEG
naming = sprintf('sub-%02d_ses-%02d_task-%s_%s',...
subNum,sesNum,BTB.task,datatype);
filename = fullfile(BTB.DataDir,sub_dire,datatype,naming);
% load data
try
[CNT{subNum,sesNum}, mrk_orig, hdr] = file_readBV(filename, 'Fs', 100);
catch
continue;
end
% create mrk
MRK{subNum,sesNum}= mrk_defineClasses(mrk_orig, trig_sti);
% segmentation
EPO{subNum,sesNum} = proc_segmentation(CNT{subNum,sesNum}, MRK{subNum,sesNum}, disp_ival);
MNT= mnt_setElectrodePositions(CNT{subNum,sesNum}.clab);
end
end