问题描述:
想要了解AAL自动解剖标记图谱与Yeo-7功能网络之间的对应关系,即AAL图谱90个脑区在Yeo7大网络中的归属信息,比如哪个脑区属于默认网络、中央前回属于哪个功能网络…,如何将两者对应起来。
解决办法:
对每个 AAL 区域内的所有体素,统计其在 Yeo7 图谱中属于哪个网络最多,相当于是“投票”,并将该区域标记为对应网络(1~7)。
matlab程序:
function aal_to_yeo7_mapping()
% 将 AAL 脑图谱的 116 个区域映射到 Yeo7 功能网络
% 方法:对每个 AAL 区域内的体素,在 Yeo7 图谱中统计所属网络频次,
% 取出现次数最多的网络作为该 AAL 区域的标签(1~7)
%% 1. 设置文件路径(·根据实际情况修改)
aal_file = 'AAL_MNI152_1x1x1.nii'; % AAL 图谱路径(116 个 ROI)
yeo7_file = 'Yeo-7_MNI152_1x1x1.nii'; % Yeo7 图谱路径(7 个网络,标签 1~7)
%% 2. 读取 NIfTI 图像数据
aal_img = niftiread(aal_file); % 读取 AAL 图谱 (H x W x D)
yeo7_img = niftiread(yeo7_file); % 读取 Yeo7 图谱 (H x W x D)
%% 3. 检查两个图像尺寸是否一致
if ~isequal(size(aal_img), size(yeo7_img))
error('AAL 和 Yeo7 图谱的空间维度不一致!请确保已配准到同一空间。');
end
%% 4. 获取 AAL 中所有唯一标签(排除 0,即背景)
aal_labels = unique(aal_img(aal_img > 0)); % 应为 1:116
num_aal = length(aal_labels); % 通常为 116
%% 5. 初始化结果数组:存储每个 AAL 区域对应的 Yeo7 网络编号
aal_yeo7_network = zeros(num_aal, 1); % 长度 116,初始为 0
%% 6. 遍历每个 AAL 区域
for i = 1:num_aal
current_label = aal_labels(i); % 当前 AAL 标签(如 1, 2, ..., 116)
% 找出当前 AAL 区域的所有体素位置(逻辑索引)
mask = (aal_img == current_label); % 与 aal_img 同尺寸的逻辑矩阵
% 提取这些位置在 Yeo7 图谱中的值
yeo7_values_in_region = yeo7_img(mask); % 一维向量,包含该区域内所有 Yeo7 标签
% 过滤掉可能的 0(虽然 Yeo7 通常无 0,但安全起见)
yeo7_values_in_region = yeo7_values_in_region(yeo7_values_in_region > 0);
% % 如果该区域没有有效体素,跳过或报错
% if isempty(yeo7_values_in_region)
% warning('AAL 区域 %d 无有效体素,跳过。', current_label);
% aal_yeo7_network(i) = NaN;
% continue;
% end
% 统计每个 Yeo7 网络(1~7)出现的次数
% 使用 histcounts,bins 为 0.5,1.5,...,7.5 确保整数分箱
edges = 0.5:1:7.5; % 分箱边界:[0.5,1.5), [1.5,2.5), ..., [6.5,7.5]
counts = histcounts(yeo7_values_in_region, edges);
% 找出出现次数最多的网络编号(若有并列,取最小编号)
[~, max_idx] = max(counts); % max_idx 是 1~7 对应的索引
dominant_network = max_idx; % 因为 edges 从 0.5 开始,max_idx 直接对应网络 1~7
% 保存结果
aal_yeo7_network(i) = dominant_network;
% 可选:打印进度
fprintf('AAL %3d -> Yeo7 Network %d\n', current_label, dominant_network);
end
%% 7. 保存结果到 .mat 文件(便于后续使用)
save('AAL_to_Yeo7_Network_Labels.mat', 'aal_yeo7_network', 'aal_labels');
fprintf('\n 映射完成!结果已保存至 AAL_to_Yeo7_Network_Labels.mat\n');
%% 8. 显示统计摘要
network_names = {'Visual', 'Somatomotor', 'Dorsal Attention', ...
'Ventral Attention', 'Limbic', 'Frontoparietal', 'Default'};
fprintf('\n各网络包含的 AAL 区域数量:\n');
for net_id = 1:7
count = sum(aal_yeo7_network == net_id);
fprintf(' 网络 %d (%s): %d 个区域\n', net_id, network_names{net_id}, count);
end
% 打印各个脑区所对应的Yeo7网络
% 将AAL标签和每个脑区的归属网络编号合并为一个 116x2 的数组
combinedArray = [aal_labels, aal_yeo7_network];
% 打印合并后的数组
fprintf('\n\n各个脑区对应的功能网络:\n');
disp(combinedArray);
end
运行结果:
各网络包含的 AAL 区域数量:
网络 1 (Visual): 46 个区域
网络 2 (Somatomotor): 13 个区域
网络 3 (Dorsal Attention): 2 个区域
网络 4 (Ventral Attention): 9 个区域
网络 5 (Limbic): 19 个区域
网络 6 (Frontoparietal): 9 个区域
网络 7 (Default): 18 个区域
各个脑区对应的功能网络:
AAL Yeo
1 2
2 2
3 7
4 7
5 5
6 5
7 6
8 6
9 6
10 6
11 4
12 6
13 6
14 6
15 7
16 7
17 2
18 2
19 4
20 2
21 5
22 5
23 7
24 7
25 7
26 7
27 5
28 5
29 4
30 4
31 7
32 7
33 4
34 4
35 7
36 7
37 5
38 1
39 5
40 5
41 5
42 5
43 1
44 1
45 1
46 1
47 1
48 1
49 1
50 1
51 1
52 1
53 1
54 1
55 1
56 1
57 2
58 2
59 3
60 3
61 6
62 6
63 4
64 4
65 7
66 7
67 7
68 7
69 2
70 2
71 5
72 5
73 4
74 1
75 1
76 1
77 1
78 1
79 2
80 2
81 2
82 2
83 5
84 5
85 7
86 7
87 5
88 5
89 5
90 5
91 1
92 1
93 1
94 1
95 1
96 1
97 1
98 1
99 1
100 1
101 1
102 1
103 1
104 1
105 1
106 1
107 1
108 1
109 1
110 1
111 1
112 1
113 1
114 1
115 1
116 1
注意:
由于Yeo7功能网络的标准版本只关注大脑,并不包含小脑,所以AAL脑区中91~116脑区(小脑部分)的划分结果可以舍弃,一般的研究也很少专门关注小脑部分。
附:
脑图谱下载地址:点击链接
1万+

被折叠的 条评论
为什么被折叠?



