-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotFig4.m
More file actions
64 lines (48 loc) · 2.3 KB
/
plotFig4.m
File metadata and controls
64 lines (48 loc) · 2.3 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
64
%% VISUALIZE THE RESULTS
lateralization={'Rtle','Ltle'};
%load ROI patch
load(fullfile(datapath,'ROIpatch.mat'))
%% define limit for colorbar
for lat=1: length(lateralization)
clear surr_thresh
%select the correct threshold, according to the sample size of the
%group
if lat==1
threshold=6;%retain ROI significant in at leasts 7/9 patients (75%)
elseif lat==2
threshold=5;%retain ROI significant in at leasts 6/8 patients (75%)
end
eval(['surr_thresh=SDI_surr_thresh_',char(lateralization(lat))]);
thr=find([surr_thresh.threshold]==threshold);
% plot coupled and decoupled ROIs
amplitude2plot=surr_thresh(thr).mean_SDI;
Max(lat,1)=max(amplitude2plot);
Min(lat,1)=min(amplitude2plot);
end
% define limits for colorbar
max_abs_val=max(max(abs(Max)),max(abs(Min)));
%as the max abs value is 2.4, we round the colorbar to 2.5
lim_colorbar=2.5;
%% actually plot
for lat=1: length(lateralization)
clear surr_thresh
%select the correct threshold, according to the sample size of the
%group
if lat==1
threshold=6;%retain ROI significant in at leasts 7/9 patients (75%)
% threshold=2;%retain ROI significant in at leats 3/9 patients
elseif lat==2
threshold=5;%retain ROI significant in at leasts 6/8 patients (75%)
% threshold=2;%retain ROI significant in at leats 3/8 patients
end
eval(['surr_thresh=SDI_surr_thresh_',char(lateralization(lat))]);
thr=find([surr_thresh.threshold]==threshold);
% plot coupled and decoupled ROIs
amplitude2plot=[surr_thresh(thr).mean_SDI; lim_colorbar; -lim_colorbar];
rgb = vals2colormap2(reshape(amplitude2plot,1,size(amplitude2plot,1)*size(amplitude2plot,2)),flipud(brewermap(256,'RdYlBu')));
rgb([end-1 end],:)=[]; %remove the last two colors as they were only used to scale all the others between -2.5 and 2.5
%plot only the ROIs that are significant with this threshold
rgb(find(surr_thresh(thr).SDI_sig==0),:)=repmat([221 221 221]/255,length(find(surr_thresh(thr).SDI_sig==0)),1);%show in grey the ROIs that ar enot significant
%plot
fig=plot_brain_mesh_mesial(ROI_patch,rgb,[char(lateralization(lat)),' threshold ',num2str(threshold+1)])
end