-
Notifications
You must be signed in to change notification settings - Fork 2
/
dbs_draw_iHubs.m
59 lines (47 loc) · 1.89 KB
/
dbs_draw_iHubs.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
function dbs_draw_iHubs( hubs, XYZ )
%DBS_DRAW_IHUBS Plots axial view of nodes proportional to 5 individual hub measures
%
% Based on hubViewerFive.m
%
% dbs_draw_iHubs(hubs, XYZ);
%
% Inputs: hubs, structure from make_hubs (selects .individual_measures)
% XYZ, Euclidean co-ordinates
%
% Michael Hart, University of Cambridge, May 2017
%% Define & initialise
hubs = hubs.individual_measures; %parse from string
nHubs = size(hubs, 2); %number of hubs form above
nNodes = size(hubs, 1);
hubNames = {'strength'; 'betweenness'; 'zscore'; 'participation'; 'eigenvector'};
%% Draw nodes
figure1 = figure('Name','hub metrics', 'Units', 'Normalized', 'Position', [0.15 0.2 0.7 0.5]); %whole page
for iHub = 1:nHubs %for each of 5 hubs, make a subplot
subplot_1_{iHub} = subplot(2,5,iHub,'Parent', figure1);
hold(subplot_1_{iHub},'on');
nodeSizes = ceil(2 * tiedrank(hubs(:,iHub)) / length(hubs));
for iNode = 1:nNodes
plot(XYZ(iNode,1), XYZ(iNode,2),'or','MarkerSize', nodeSizes(iNode)*3, 'MarkerEdgeColor','k','MarkerFaceColor','r');
end %end individual hub loop
set(gca,'xaxislocation','top');
title(hubNames{iHub});
xlabel({'anterior'});
ylabel({'lateral'});
set(gca,'visible','off');
set(findall(gca, 'type', 'text'), 'visible', 'on');
end
for iHub = 1:nHubs
subplot_{iHub+5} = subplot(2,5,iHub+5,'Parent', figure1);
hold(subplot_{iHub+5},'on');
nodeSizes = ceil(2 * tiedrank(hubs(:,iHub)) / length(hubs));
for iNode = 1:nNodes
plot(XYZ(iNode,2), XYZ(iNode,3),'or','MarkerSize', nodeSizes(iNode)*3, 'MarkerEdgeColor','k','MarkerFaceColor','r');
end %end individual hub loop
set(gca,'xaxislocation','top');
title(hubNames{iHub});
xlabel({'superior'});
ylabel({'posterior'});
set(gca,'visible','off');
set(findall(gca, 'type', 'text'), 'visible', 'on');
end %end plotting of all hubs
end