-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathThe_EPOCH.m
86 lines (55 loc) · 2.16 KB
/
The_EPOCH.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
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
%% epoch and warp script
clear all;
close all;
%% specifications
goodSubs = {1, 2, 8, 9, 10, 11};
VR = {1, 2, 9};
noVR = {8, 10, 11};
condition = {'_A_VR','_B_VR','_A','_B'};
study_file_path = 'C:\Users\ericw\Desktop\Master_Thesis\Data\CURRENT_DATA\';
directions = {'left', 'right'};
maxLatency_ms = 0;
subject = goodSubs{isub};
sub_id = sprintf('%03d', subject);
if ismember(subject, cell2mat(VR))
blocks = 1:2;
else
blocks = 3:4;
end
%% start looping
for isub = 1:length(goodSubs)
for iblock = blocks
%% import
data_path = [study_file_path '2_PREPROCESSED\P' sub_id];
file_name_39 = ['P' sub_id condition{iblock} '_39_bandpass.set'];
file_name_41 = ['P' sub_id condition{iblock} '_41_bandpass.set'];
EEG_39 = pop_loadset('filename', file_name_39, 'filepath', data_path);
EEG_41 = pop_loadset('filename', file_name_41, 'filepath', data_path);
fprintf('You have successfully imported the data!!\n');
%% find max durations
ASSR_epoch_durations
%% epoch data
ASSR_epoch_exec
%% set newLatency for timewarp
ASSR_epoch_newLatency
end
end
for isub = 1:length(goodSubs)
for iblock = blocks
%% import
data_path = [study_file_path '2_PREPROCESSED\P' sub_id];
file_name_39 = ['P' sub_id condition{iblock} '_39_bandpass.set'];
file_name_41 = ['P' sub_id condition{iblock} '_41_bandpass.set'];
EEG_39 = pop_loadset('filename', file_name_39, 'filepath', data_path);
EEG_41 = pop_loadset('filename', file_name_41, 'filepath', data_path);
fprintf('You have successfully imported the data!!\n');
%% find max durations
ASSR_epoch_durations
%% epoch data
ASSR_epoch_exec
%% set evLatency
ASSR_epoch_evLatency
%% warp it baby
ASSR_epoch_warp
end
end