-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPaperCode_PTE_circlePlot.m
More file actions
63 lines (54 loc) · 1.46 KB
/
PaperCode_PTE_circlePlot.m
File metadata and controls
63 lines (54 loc) · 1.46 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
freqs_name = {'delta', 'theta', 'alpha', 'sigma', 'beta', 'gamma'};
epi = mean_pre;
for f=1:6
name = 'pre_';
TF1 = epi.TF(:,:,f);
%threshold = prctile(TF(:),99.5);
threshold_k = min(maxk(abs(TF1(:)),100));
TF2 = TF1;
TF2(abs(TF2)<threshold_k)=0;
%
TFM = reshape(TF2, [148, 148]);
to_del = [];
for i = 1:148
nnz(TFM(i,:)) + nnz(TFM(:,i))
if nnz(TFM(i,:)) + nnz(TFM(:,i)) == 0
to_del = [to_del i];
end
end
Batlas = epi.Atlas.Scouts;
Batlas(to_del) = [];
for i=1:148
for j=1:148
if TFM(i,j) < 0
TFM(j,i) = -TFM(i,j);
TFM(i,j) = 0;
end
end
end
TFM(TFM>0)=1;
regions=struct2cell(Batlas);
labels1=regions(6,:).';
scoutl=regions(4,:).';
uniques={'LL';'LO';'LP';'LT';'LC';'LF';'LPF';'RPF';'RF';'RC';'RT';'RP';'RO';'RL' };
rng(1);
ii=1;
reord_label = cell(148,1);
reord_scout = cell(148,1);
reord_idx = [];
for i=1:length(uniques);
for j=1:length(scoutl);
if ismember(labels1(j),uniques(i));
reord_label(ii) = uniques(i);
reord_idx(ii) = j;
reord_scout(ii) = scoutl(j);
ii=ii+1;
end
end
end
B = TFM(:,reord_idx);
reord_M = B(reord_idx,:);
end
save ("reord_labelHigh.mat", "reord_label");
save ("reord_scouts.mat", "reord_scout");
save ("TFM_reord.mat", "reord_M");