-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFig2.m
160 lines (121 loc) · 3.82 KB
/
Fig2.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
%% This code is for generating plots of Figure 2 by Chen et al., 2023
% Rights reserved for Biophotonics And Ultrasound Imaging Laboratory, The Pennsylvania State University.
clear all
close all
load("Fig2Data.mat") % Loading of data
%% Fig. 2a - atlas
% The atlas template was adopted from https://scalablebrainatlas.incf.org/rat/PLCJB14
% Papp E.A., Leergaard T.B., Calabrese E., Johnson G.A., Bjaalie J.G. (2014). Waxholm Space atlas of the Sprague Dawley rat brain. NeuroImage 97, 374-386. http://doi.org/10.1016/j.neuroimage.2014.04.001
%% Fig. 2b - fUS
% Code Plotting for Bregma -5.5:
figure; % Creating a plot
imagesc(mask_fUS.*(interpn(squeeze(vol_B_55) - max(max(squeeze(vol_B_55)))))); % Plotting the data
axis image % Creating axis for the plot
colormap(gray) % Setting colormap for the plot
caxis([-60 0]) % Setting limits for colormap
title('Figure 2b Bregma -5.5') % Creating a title
% Code Plotting for Bregma -4.0:
figure;
imagesc(mask_fUS.*(interpn(squeeze(vol_B_4) - max(max(squeeze(vol_B_4))))));
axis image
colormap(gray)
caxis([-60 0])
title('Figure 2b Bregma -4.0')
% Code Plotting for Bregma -2.7:
figure;
imagesc(mask_fUS.*(interpn(squeeze(vol_B_27) - max(max(squeeze(vol_B_27))))));
axis image
colormap(gray)
caxis([-60 0])
title('Figure 2b Bregma -2.7')
%% Fig. 2c - US velocimetry
% Code Plotting for Bregma -5.5:
figure;
imagesc(interpn(squeeze(Vz_vol_all_B_55)));
axis image
colormap(bluered_l)
title('Figure 2c Bregma -5.5')
% Code Plotting for Bregma -4.0:
figure;
imagesc(interpn(squeeze(Vz_vol_all_B_4)));
axis image
colormap(bluered_l)
title('Figure 2c Bregma -4.0')
% Code Plotting for Bregma -2.7:
figure;
imagesc(interpn(squeeze(Vz_vol_all_B_27)));
axis image
colormap(bluered_l)
title('Figure 2c Bregma -2.7')
%% Fig. 2d - SO2
% Code Plotting for Bregma -5.5:
figure;
imagesc(interpn(mask_sO2.*vol_sO2_B_55));
axis image
colormap(redblue)
caxis([0 1])
title('Figure 2d Bregma -5.5')
% Code Plotting for Bregma -4.0:
figure;
imagesc(interpn(mask_sO2.*vol_sO2_B_4));
axis image
colormap(redblue)
caxis([0 1])
title('Figure 2d Bregma -4.0')
% Code Plotting for Bregma -2.7:
figure;
imagesc(interpn(mask_sO2.*vol_sO2_B_27));
axis image
colormap(redblue)
caxis([0 1])
title('Figure 2d Bregma -2.7')
%% Fig. 2e-g - 3D fUS, US velocimetry, and SO2 maps were created by ImageJ VolumeViewer
% The data for volumetric view creation can be found in XXX.mat as variable
% names - XXX for 3D fUS, XXX for ...
%% Defining colormap bluered_l function
function cmap = bluered_l
cmap = zeros(100,3);
index_1 = 1:25;
index_2 = 26:50;
index_3 = 51:75;
index_4 = 76:100;
% define r
cmap(index_1,1) = linspace(1,1,length(index_1));
cmap(index_2,1) = linspace(1,0,length(index_2));
cmap(index_3,1) = linspace(0,0,length(index_3));
cmap(index_4,1) = linspace(0,0.427,length(index_4));
% define g
cmap(index_1,2) = linspace(0.616,0.18,length(index_1));
cmap(index_2,2) = linspace(0.18,0,length(index_2));
cmap(index_3,2) = linspace(0,0.353,length(index_3));
cmap(index_4,2) = linspace(0.353,0.843,length(index_4));
% define b
cmap(index_1,3) = linspace(0.839,0.565,length(index_1));
cmap(index_2,3) = linspace(0.565,0,length(index_2));
cmap(index_3,3) = linspace(0,0.804,length(index_3));
cmap(index_4,3) = linspace(0.804,1,length(index_4));
end
%% Defining colormap redblue function
function c = redblue(m)
%REDBLUE Shades of red and blue color map
% Adam Auton, 9th October 2009
if nargin < 1, m = size(get(gcf,'colormap'),1); end
if (mod(m,2) == 0)
% From [0 0 1] to [1 1 1], then [1 1 1] to [1 0 0];
m1 = m*0.5;
r = (0:m1-1)'/max(m1-1,1);
g = r;
r = [r; ones(m1,1)];
g = [g; flipud(g)];
b = flipud(r);
else
% From [0 0 1] to [1 1 1] to [1 0 0];
m1 = floor(m*0.5);
r = (0:m1-1)'/max(m1,1);
g = r;
r = [r; ones(m1+1,1)];
g = [g; 1; flipud(g)];
b = flipud(r);
end
c = [r g b];
end