-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.m
54 lines (48 loc) · 1.47 KB
/
demo.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
% DEMO CODE
% THis will use the lesMaskDemo volume and remove those streamlines that
% intersect with the pseudo lesion
try
figure
h1 = slice([-91:90], [-109:108], [-91:90],permute(lesMaskDemo, [2 1 3]),0,0, 0, 'nearest');shading flat;
hold on
h2 = trisurf(BrainTri);
set(h2,'FaceAlpha', .3, 'EdgeAlpha', .5, 'FaceColor', 'blue');
disp('Lesion mask is in yellow in center')
catch
disp('Unable to display the brain mesh and demo lesion mask')
end
disp('Using the Virtual Structural Connectome code:')
% currently parcels is the Lausanne-60 parcellation
[sc_new,rc] = getLesionMaskConnectome(allTractsInterp, parcels,lesMaskDemo);
sc_new = sc_new .* double(~eye(length(sc_new))); % diagonal contains degrees for each node right now, removing that
rc = rc .* double(~eye(length(sc_new)));
% Ahead: removing non-homotopic connections - optional;
% SC matrix used here needs to be recreated for the parcellation applied.
% Use with caution.
redConn = rc.*(SC>0);
fullsc = sc_new.* (SC>0);
%%
disp('Binary SC and Virtual SC')
figure
subplot(121)
imagesc(fullsc>0)
axis square
title('Binary SC','Fontsize', 18)
subplot(122)
imagesc(redConn>0)
axis square
title('Binary Virtual SC', 'Fontsize', 18)
disp('Weighted SC and Virtual SC')
figure
subplot(121)
imagesc(log(fullsc+eps))
axis square
caxis([-5,5])
colorbar
title('Weighted SC', 'Fontsize', 18)
subplot(122)
imagesc(log(redConn+eps))
axis square
caxis([-5,5])
title('Weighted Virtual SC', 'Fontsize', 18)
colorbar