-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFig5_concepts.m
235 lines (191 loc) · 7.37 KB
/
Fig5_concepts.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
% Script to generate brain plots for illustrating the concept of the paper.
% Random values were chosen for illustration purposes of the concept behind
% the actual findings.
% Code for Simple-Brain-Plot can be obtained from
% https://github.com/dutchconnectomelab/Simple-Brain-Plot/tree/main.
% Change sw_dir accordingly.
clear; clc;
sw_dir = '/code/Simple-Brain-Plot'; % adapt path to Simple-Brain-Plot
addpath(sw_dir);
wd = pwd();
outdir = fullfile(wd, 'outputs', 'concept_figure');
mkdir(outdir);
%% define brain plot variables
% Create a gray color map
gray_map = [1, 1, 1; 0, 0, 0]; % Start with white and end with black
numColors = 34;
x = linspace(1, size(gray_map, 1), numColors);
cm = interp1(1:size(gray_map, 1), gray_map, x, 'linear');
colormap(cm);
set(gcf, 'Color', 'w');
saveas(gcf, fullfile(outdir, 'colorbar_grayscale.svg'));
% also create a red to green colorbar for the environment (taken from Simple-Brain-Plot git)
cm_env = [0.8431 0.1882 0.1529; ...
0.9569 0.4275 0.2627; ...
0.9922 0.6824 0.3804; ...
0.9961 0.8784 0.5451; ...
1.0000 1.0000 0.7490; ...
0.8510 0.9373 0.5451; ...
0.6510 0.8510 0.4157; ...
0.4000 0.7412 0.3882; ...
0.1020 0.5961 0.3137];
%cm_env_smooth = interp1(1:size(cm_env, 1), cm_env, linspace(1, size(cm_env, 1), 500), 'linear');
cm_env = interp1(cm_env, 1:0.01:size(cm_env,1));
colormap(cm_env);
c = colorbar;
c.Ticks = [];
c.Box = 'off';
set(gcf, 'Color', 'w');
saveas(gcf, fullfile(outdir, 'colorbar_env.svg'));
% load aparc regions
load(fullfile(sw_dir,'examples', 'regionDescriptions.mat'));
%% Group difference
% age birth
values = zeros(size(regionDescriptions.aparc_aseg));
values(55) = 0.1; % inferiorparietal
values(59) = 0.05; % lateralorbitofrontal
values(62) = 0.15; % middletemporal
values(74) = 0.15; % rostral middle frontal
values(75) = 0.3; % superior frontal
values(77) = 0.1; % superior temporal
values(78) = 0.05; % supramarginal
values(80) = 0.05; % temporal pole
values(82) = 0.3; % insula
outname = fullfile(outdir, 'group_diff_age_30w.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%--------------------------------------------
% age 7
values = zeros(size(regionDescriptions.aparc_aseg));
values(55) = 0.25; % inferiorparietal
values(59) = 0.15; % lateralorbitofrontal
values(62) = 0.25; % middletemporal
values(74) = 0.1; % rostral middle frontal
values(75) = 0.25; % superior frontal
values(77) = 0.1; % superior temporal
values(78) = 0.15; % supramarginal
values(80) = 0.1; % temporal pole
values(82) = 0.25; % insula
outname = fullfile(outdir, 'group_diff_age_7y.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%---
% age 25
values = zeros(size(regionDescriptions.aparc_aseg));
values(55) = 0.35; % inferiorparietal
values(59) = 0.2; % lateralorbitofrontal
values(62) = 0.5; % middletemporal
values(74) = 0.15; % rostral middle frontal
values(75) = 0.35; % superior frontal
values(77) = 0.1; % superior temporal
values(78) = 0.15; % supramarginal
values(80) = 0.2; % temporal pole
values(82) = 0.15; % insula
outname = fullfile(outdir, 'group_diff_age_25y.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1], 'savePath', outname);
%% Individual plots IBAPs
% Subject 1 (red SES), age birth
values = zeros(size(regionDescriptions.aparc_aseg));
values(62) = 0.6; % middletemporal
values(77) = 0.4; % superior temporal
values(69) = 0.5; % postcentral
values(75) = 0.5; % superior frontal
values(74) = 0.6; % rostral middle frontal
values(66) = 0.7; % pars orbitalis
values(58) = 0.3; % lateral occipital
values(80) = 0.3; % temporal pole
outname = fullfile(outdir, 'sub1_age_birth.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%---
% Subject 1, age 7y
values = zeros(size(regionDescriptions.aparc_aseg));
values(62) = 0.9; % middletemporal
values(77) = 0.6; % superior temporal
values(69) = 0.8; % postcentral
values(75) = 0.7; % superior frontal
values(74) = 0.6; % rostral middle frontal
values(66) = 0.8; % pars orbitalis
values(58) = 0.3; % lateral occipital
values(80) = 0.5; % temporal pole
outname = fullfile(outdir, 'sub1_age_7y.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%---
% Subject 1, age 25y
values = zeros(size(regionDescriptions.aparc_aseg));
values(62) = 1; % middletemporal
values(77) = 0.8; % superior temporal
values(69) = 1; % postcentral
values(75) = 0.85; % superior frontal
values(74) = 0.7; % rostral middle frontal
values(66) = 0.9; % pars orbitalis
values(58) = 0.5; % lateral occipital
values(80) = 0.8; % temporal pole
outname = fullfile(outdir, 'sub1_age_25y.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%% Subject 2
% Subject 2, birth
values = zeros(size(regionDescriptions.aparc_aseg));
values(78) = 0.7; % supramarginal
values(65) = 0.7; % pars opercularis
values(51) = 0.5; % caudal middle frontal
values(56) = 0.9; % inferior temporal
values(59) = 0.6; % lateral orbitofrontal
outname = fullfile(outdir, 'sub2_age_birth.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%---
% Subject 2, 7 y
values = zeros(size(regionDescriptions.aparc_aseg));
values(78) = 0.3; % supramarginal
values(65) = 0.75; % pars opercularis
values(51) = 0.5; % caudal middle frontal
values(56) = 0.65; % inferior temporal
values(59) = 0.7; % lateral orbitofrontal
outname = fullfile(outdir, 'sub2_age_7y.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%---
% Subject 2, 25 y
values = zeros(size(regionDescriptions.aparc_aseg));
values(78) = 0.4; % supramarginal
values(65) = 0.75; % pars opercularis
values(51) = 0.45; % caudal middle frontal
values(56) = 0.75; % inferior temporal
values(59) = 0.7; % lateral orbitofrontal
outname = fullfile(outdir, 'sub2_age_25y.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%% Subject 3
% Subject 3, birth
values = zeros(size(regionDescriptions.aparc_aseg));
values(69) = 0.7; % postcentral
values(77) = 0.3; % superior temporal
values(81) = 0.5; % transverse temporal
values(62) = 0.2; % middletemporal
outname = fullfile(outdir, 'sub3_age_birth.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%---
% Subject 3, 7y
values = zeros(size(regionDescriptions.aparc_aseg));
values(69) = 0.6; % postcentral
values(77) = 0.25; % superior temporal
values(81) = 0.7; % transverse temporal
outname = fullfile(outdir, 'sub3_age_7y.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%---
% Subject 3, 25y
values = zeros(size(regionDescriptions.aparc_aseg));
values(69) = 0.6; % postcentral
values(77) = 0.5; % superior temporal
values(81) = 0.8; % transverse temporal
outname = fullfile(outdir, 'sub3_age_25y.svg');
plotBrain(regionDescriptions.aparc_aseg, values, cm, 'atlas', 'aparc', ...
'limits', [0,1],'savePath', outname);
%----------
close all;