-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_NC_cluster_data.m
102 lines (76 loc) · 3.12 KB
/
get_NC_cluster_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
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
function [cond1a,cond2a,cond3a,cond4a] = get_NC_cluster_data(subj_list, ref, baseline, exp_type, lock)
cd(['/mnt/yassamri/iEEG/sandra/group_data/groupdata_spectrograms/' ref '_reref/' exp_type '_' lock ])
regList = { 'OFC' 'FRO' 'TEMP' 'CING' 'INS' 'EC'};
cntr = 0;
for iReg = 1:length(regList)
for subj = 1:length(subj_list)
load(['subj' subj_list{subj} 'spectrograms' baseline '.mat'])
if strcmp('encoding',exp_type)
if strcmp('OFC',regList{iReg})
data2 = OFC_cond2;
data3 = OFC_cond1;
elseif strcmp('FRO',regList{iReg})
data2 = fro_cond2;
data3 = fro_cond1;
elseif strcmp('TEMP',regList{iReg})
data2 = temp_cond2;
data3 = temp_cond1;
elseif strcmp('CING',regList{iReg})
data2 = cing_cond2;
data3 = cing_cond1;
elseif strcmp('INS',regList{iReg})
data2 = ins_cond2;
data3 = ins_cond1;
elseif strcmp('EC',regList{iReg})
data2 = EC_cond2;
data3 = EC_cond1;
end
if ~isempty(data2)
cntr = cntr+1;
cond2a{cntr} = nanmean(data2,3);
cond3a{cntr} = nanmean(data3,3);
cond1a=[];cond4a=[];
end
else strcmp('tuning_correct', exp_type)
if strcmp('OFC',regList{iReg})
data1 = OFC_cond1;
data2 = OFC_cond2;
data3 = OFC_cond3;
data4 = OFC_cond4;
elseif strcmp('FRO',regList{iReg})
data1 = fro_cond1;
data2 = fro_cond2;
data3 = fro_cond3;
data4 = fro_cond4;
elseif strcmp('TEMP',regList{iReg})
data1 = temp_cond1;
data2 = temp_cond2;
data3 = temp_cond3;
data4 = temp_cond4;
elseif strcmp('CING',regList{iReg})
data1 = cing_cond1;
data2 = cing_cond2;
data3 = cing_cond3;
data4 = cing_cond4;
elseif strcmp('INS',regList{iReg})
data1 = ins_cond1;
data2 = ins_cond2;
data3 = ins_cond3;
data4 = ins_cond4;
elseif strcmp('EC',regList{iReg})
data1 = EC_cond1;
data2 = EC_cond2;
data3 = EC_cond3;
data4 = EC_cond4;
end
if ~isempty(data2)
cntr = cntr+1;
cond1a{cntr} = nanmean(data1,3);
cond2a{cntr} = nanmean(data2,3);
cond3a{cntr} = nanmean(data3,3);
cond4a{cntr} = nanmean(data4,3);
end
end
end
end
end