-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsepa_parrotImportZ.m
More file actions
48 lines (39 loc) · 1.43 KB
/
sepa_parrotImportZ.m
File metadata and controls
48 lines (39 loc) · 1.43 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
function [zHi, zLo] = sepa_parrotImportZ(filename)
% AIS = sepa_parrottImportZ(filename)
%
% Imports a single TAP file and computes the alpha asymmetry scores.
% Designed to be called from a wrapper function like sepa_TAPBlockImport.m.
%
% WARNING: This file is broken for Parrott style experiments, it was
% modified (by mistake) for hand contraction experiments!!!)
%
% MDT
% 2017.02.27
% 0.0.1 ALPHA
lowerBound = 1;
upperBound = 41;
eegChannels = 3:16;
% The file in loaded (or imported) and a "derived" data set is made
% that contains the EEG data only. The original data with markers
% is in EEG2; the selected/filtered data is in EEG_only.
if regexp(filename,'set$')
EEG = pop_loadset(filename);
elseif regexp(filename,'edf$')
EEG = pop_biosig(filename);
else
error('sepa_parrotImportZ: File type unknown!');
end
EEG_only = pop_select(EEG, 'channel', eegChannels);
EEG_only = pop_eegfilt(EEG_only, lowerBound, upperBound, [], [0], 0, 0, 'fir1', 0);
% Make the blocks of selected/filtered data:
for m = 3:5
ss = ge_getSampleBounds(EEG, m); % Bounds from EEG2
data{m} = EEG_only.data(:,ss(1):ss(2)); % Data from EEG_only
end
% Do the analysis to each block:
blob.Fs = 128;
for ii = 3:5
blob.data = data{ii}';
[zHi{ii}, zLo{ii}] = sepa_subjectNormalizedSiteScores(blob);
end
end