-
Notifications
You must be signed in to change notification settings - Fork 4
/
Script_reproduce_figure_ICASSP.m
169 lines (144 loc) · 4.87 KB
/
Script_reproduce_figure_ICASSP.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
%-- Script used to display the results for SPL
clear all;
close all;
clc
%% Noiseless case - intersensor spacing 1 wavelength
%-- filnename
filename_prefix = 'results/results_';
filnename_suffix = 'channel_synth_pulse.mat';
list_scenarios=[1, 2, 5, 10];
it = 1;
for ll=1:numel(list_scenarios)
scenario = list_scenarios(ll);
filename = strcat([filename_prefix, num2str(scenario), filnename_suffix]);
load(filename);
for kk = 1:size(nmse, 1)
nmse(kk, isnan(nmse(kk,:))) = max(nmse(kk,:));
end
nmse_mean(ll, :) = mean(sqrt(nmse),2);
end
figure('Color', [1 1 1]);
plot(meas_ratio(1:15), nmse_mean(1, 1:15), '--o', 'LineWidth', 1.5);
hold on
plot(meas_ratio(1:15), nmse_mean(2, 1:15), '--x', 'LineWidth', 1.5);
hold on
plot(meas_ratio(1:15), nmse_mean(3, 1:15), '--d', 'LineWidth', 1.5);
hold on
plot(meas_ratio(1:15), nmse_mean(4, 1:15), '--+', 'LineWidth', 1.5);
grid on
xlabel 'Compression ratio (M/N)'
ylabel 'Normalized MSE'
legend('1channel', '2 channels', '5 channels', '10 channels');
set(gca,'fontsize',14, 'GridLineStyle', ':')
set(gcf, 'PaperPositionMode', 'auto');
%% Noiseless case - intersensor spacing 2 wavelengths
%-- Prefix and suffix of the filename
filename_prefix = 'results/results_';
filnename_suffix = 'channel_synth_pulse_2lambda.mat';
%-- List of scenarios (number of channels involved)
list_scenarios=[1, 2, 5, 10];
%-- Loop over the scenarios
for ll=1:numel(list_scenarios)
scenario = list_scenarios(ll);
%-- Load the corresponding filename
filename = strcat([filename_prefix, num2str(scenario), filnename_suffix]);
load(filename);
%-- Calculate the average mse over all the draws
for kk = 1:size(nmse, 1)
nmse(kk, isnan(nmse(kk,:))) = max(nmse(kk,:));
end
nmse_mean(ll, :) = mean(sqrt(nmse),2);
end
figure('Color', [1 1 1]);
plot(meas_ratio(1:15), nmse_mean(1,1:15), '--o', 'LineWidth', 1.5);
hold on
plot(meas_ratio(1:15), nmse_mean(2,1:15), '--x', 'LineWidth', 1.5);
hold on
plot(meas_ratio(1:15), nmse_mean(3,1:15), '--d', 'LineWidth', 1.5);
hold on
plot(meas_ratio(1:15), nmse_mean(4,1:15), '--+', 'LineWidth', 1.5);
grid on
xlabel 'Compression ratio (M/N)'
ylabel 'Normalized MSE'
legend('1channel', '2 channels', '5 channels', '10 channels');
set(gca,'fontsize',14, 'GridLineStyle', ':')
set(gcf, 'PaperPositionMode', 'auto');
%% Noisy case
%-- Single channel scenario
filename = 'results/results_1channel_noisy.mat';
load(filename);
min_c = min(channel);
max_c = max(channel);
% Plot the results
figure('Color', [1 1 1])
plot(t*10^3, channel_noisy);
xlabel 'Time [ms]'
axis([0 0.07 min_c max_c])
set(gca,'fontsize',14, 'GridLineStyle', ':')
set(gcf, 'PaperPositionMode', 'auto');
figure('Color', [1 1 1]);
plot(t*10^3, channel);
xlabel 'Time [ms]'
axis([0 0.07 min_c max_c])
set(gca,'fontsize',14, 'GridLineStyle', ':')
set(gcf, 'PaperPositionMode', 'auto');
figure('Color', [1 1 1]);
plot(t*10^3, channel_est);
axis([0 0.07 min_c max_c])
xlabel 'Time [ms]'
set(gca,'fontsize',14, 'GridLineStyle', ':')
set(gcf, 'PaperPositionMode', 'auto');
%-- 5 channels scenario
filename = 'results/results_multichannel_noisy.mat';
load(filename);
% Plot the results
figure('Color', [1 1 1]);
plot(t*10^3, channel_est);
axis([0 0.07 min_c max_c])
xlabel 'Time [ms]'
set(gca,'fontsize',14, 'GridLineStyle', ':')
set(gcf, 'PaperPositionMode', 'auto');
%% in-vivo NDE image
clear all;
filename = 'results/results_invivo_cnd.mat';
load(filename);
%-- PSNR
bmode_c_rec1_int = (bmode_rec_1channel - min(min(bmode_rec_1channel)))/(max(max(bmode_rec_1channel))- min(min(bmode_rec_1channel)));
bmode_c_rec_int = (bmode_rec_2channels - min(min(bmode_rec_2channels)))/(max(max(bmode_rec_2channels))- min(min(bmode_rec_2channels)));
bmode_c_ref_int = (bmode_ref - min(min(bmode_ref)))/(max(max(bmode_ref))- min(min(bmode_ref)));
psnr_1channel = psnr(bmode_c_rec1_int, bmode_c_ref_int);
psnr_multichannel = psnr(bmode_c_rec_int, bmode_c_ref_int);
%-- Reference image
figure('Color', [1 1 1])
imagesc(xim*1000, zim*1000, bmode_ref);
axis image
caxis([0, 100])
colorbar
colormap('bone')
xlabel('Lateral dimension [mm]')
ylabel('Depth [mm]')
title 'Reference B-mode image'
set(gca,'fontsize',14, 'GridLineStyle', ':')
set(gcf, 'PaperPositionMode', 'auto');
figure('Color', [1 1 1])
imagesc(xim*1000, zim*1000, bmode_rec_1channel);
axis image
caxis([0, 100])
colorbar
colormap('bone')
xlabel('Lateral dimension [mm]')
ylabel('Depth [mm]')
set(gca,'fontsize',14, 'GridLineStyle', ':')
set(gcf, 'PaperPositionMode', 'auto');
title(['B-mode image (3% measurements)- 1 channel - PSNR= ', num2str(psnr_1channel), 'dB']);
figure('Color', [1 1 1])
imagesc(xim*1000, zim*1000, bmode_rec_2channels);
axis image
caxis([0, 100])
colorbar
colormap('bone')
xlabel('Lateral dimension [mm]')
ylabel('Depth [mm]')
set(gca,'fontsize',14, 'GridLineStyle', ':')
set(gcf, 'PaperPositionMode', 'auto');
title(['B-mode image (3% measurements)- multichannel - PSNR= ', num2str(psnr_multichannel), 'dB']);