-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathshowResults.m
130 lines (119 loc) · 3.18 KB
/
showResults.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
function [] = showResults(T1, T2, PD, k_space_undersampling_ratio)
%Compare results between methods: T1, T2 and PD maps
% close all;
%% T1
T1_value = 2500;
T1_value_error = 500;
T2_value = 500;
T2_value_error = 200;
PD_value = 116.8877;
PD_value_error = 23.3775;
figure('Name', 'T1 T2 PD weighted images', 'NumberTitle', 'off');
colormap(hot);
subplot(3, 3, 1);
imagesc(T1.full, [0, T1_value]);
title('T1 Gold standard', 'FontSize', 12.5);
axis off;
axis image;
colorbar;
subplot(3, 3, 2);
imagesc(T1.old_mrf, [0, T1_value]);
% title(['Fully sampled MRF'],'FontSize',12.5);axis off;
title(['MRF ', num2str(k_space_undersampling_ratio*100), '% sampled'], 'FontSize', 12.5);
axis off;
axis image;
colorbar;
subplot(3, 3, 3);
imagesc(T1.giraf, [0, T1_value]);
% set(gca,'fontsize',12.5);
title(['GIRAF ', num2str(k_space_undersampling_ratio*100), '% sampled'], 'FontSize', 12.5);
axis off;
axis image;
colorbar;
%% T2
subplot(3, 3, 4);
imagesc(T2.full, [0, T2_value]);
title('T2 Gold standard', 'FontSize', 12.5);
axis off;
axis image;
colorbar;
subplot(3, 3, 5);
imagesc(T2.old_mrf, [0, T2_value]);
axis off;
axis image;
colorbar;
subplot(3, 3, 6);
imagesc(T2.giraf, [0, T2_value]);
axis off;
axis image;
colorbar;
%% PD
subplot(3, 3, 7);
imagesc(PD.full, [0, PD_value]);
title('PD Gold standard', 'FontSize', 12.5);
axis off;
axis image;
colorbar;
subplot(3, 3, 8);
imagesc(PD.old_mrf, [0, PD_value]);
axis off;
axis image;
colorbar;
subplot(3, 3, 9);
imagesc(PD.giraf, [0, PD_value]);
axis off;
axis image;
colorbar;
%% Error maps
figure('Name', 'Error maps', 'NumberTitle', 'off');
colormap(hot);
%% T1
mse_old_mrf = goodnessOfFit(T1.old_mrf(:), T1.full(:), 'NMSE');
subplot(3, 2, 1);
imagesc(abs(T1.old_mrf-T1.full), [0, T1_value_error]);
axis off;
axis image;
colorbar;
% title('Fully Sampled MRF','FontSize',12.5);
title('MRF', 'FontSize', 20);
text(-20, 55, 'T1', 'FontSize', 15);
text(20, 140, ['NMSE=', num2str(mse_old_mrf)], 'FontSize', 12.5);
mse_cs = goodnessOfFit(T1.giraf(:), T1.full(:), 'NMSE');
subplot(3, 2, 2);
imagesc(abs(T1.giraf-T1.full), [0, T1_value_error]);
axis off;axis image;
% colorbar;set(gca,'fontsize',12.5);
title('GIRAF', 'FontSize', 20);
text(20, 140, ['NMSE=', num2str(mse_cs)], 'FontSize', 12.5);
colorbar;
%% T2
mse_old_mrf = goodnessOfFit(T2.old_mrf(:), T2.full(:), 'NMSE');
subplot(3, 2, 3);
imagesc(abs(T2.old_mrf-T2.full), [0, T2_value_error]);
axis off;
axis image;
text(-20, 55, 'T2', 'FontSize', 15);
text(20, 140, ['NMSE=', num2str(mse_old_mrf)], 'FontSize', 12.5);
colorbar;
mse_cs = goodnessOfFit(T2.giraf(:), T2.full(:), 'NMSE');
subplot(3, 2, 4);
imagesc(abs(T2.giraf-T2.full), [0, T2_value_error]);
axis off;axis image;
text(20, 140, ['NMSE=', num2str(mse_cs)], 'FontSize', 12.5);
colorbar;
%% PD
mse_old_mrf = goodnessOfFit(PD.old_mrf(:), PD.full(:), 'NMSE');
subplot(3, 2, 5);
imagesc(abs(PD.old_mrf-PD.full), [0, PD_value_error]);
axis off;
axis image;
text(-22, 55, 'PD', 'FontSize', 15);
text(20, 140, ['NMSE=', num2str(mse_old_mrf)], 'FontSize', 12.5);
colorbar;
mse_cs = goodnessOfFit(PD.giraf(:), PD.full(:), 'NMSE');
subplot(3, 2, 6);
imagesc(abs(PD.giraf-PD.full), [0, PD_value_error]);
axis off;axis image;
text(20, 140, ['NMSE=', num2str(mse_cs)], 'FontSize', 12.5);
colorbar;
end