forked from cest-sources/NBM2022_CEST-B0-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_Fig2_3.m
267 lines (244 loc) · 10.4 KB
/
make_Fig2_3.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
%% analytic Z-spectra
% Date: 2021/12/21
% Version for CEST-sources.de
% Author: Moritz Zaiss - moritz.zaiss@uk-erlangen.de
% CEST sources Copyright (C) 2021 Moritz Zaiss
% **********************************
% This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or(at your option) any later version.
% This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
% You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
% **********************************
%
% --SHORT DOC--
% Figure 2 and 3 from the review CEST(B0) NBM
% Wang 7 Pool Model in WM at different B0 loaded from the pulseq cest library
%% Installation of analytical Z_cw
% if you do not have git installed you can use the commented lines to unzip
% the code directly from GitHub:
% unzip("hhttps://github.com/cest-sources/Z-cw/archive/refs/tags/v1.0.1.zip");
if exist('Z-cw', 'dir')
disp('Z-cw already installed, skip...')
else
system('git clone -b v1.0.1 https://github.com/cest-sources/Z-cw');
addpath(genpath([pwd '/Z-cw'] ));
end
%% Installation of pulseq CEST and pusleq CEST lirbrary - required for pool model
% if you do not have git installed you can use the commented lines to unzip
% the code directly from GitHub:
% unzip("https://github.com/kherz/pulseq-cest/archive/master.zip");
% movefile('pulseq-cest-master', 'pulseq-cest');
if exist('pulseq-cest', 'dir')
disp('pulseq-cest-library already installed, skip...')
else
system('git clone -b v1.0.0 https://github.com/kherz/pulseq-cest');
cd pulseq-cest;
install_pulseqcest;
cd ..
end
pulseqCEST_simlib=[pwd '\pulseq-cest-library\sim-library\'];
addpath(genpath([pwd '/pulseq-cest-library'] ));
%% SETUP
clearvars P Pref Pstart
clc
% bmsimfile='WM_3T_Stanisz2005_5pool_bmsim.yaml';
bmsimfile='WM_3T_Wang2020_5pool_bmsim.yaml';
Psim = readSimulationParameters([pulseqCEST_simlib bmsimfile]);
% setup sequence parameters
P.Zi=1; % Z initial, in units of thermal M0, Hyperpol.: 10^4
P.FREQ=300; % static B0 field [MHz] ~7T ; ppm and µT are used for offsets and B1, therefore gamma=267.5153 is given in Hz.
P.B1=0.75; % irradiation amplitude [µT]
P.tp=2; % pulse duration = saturation time [s]
P.xZspec= [-6:0.05:6]; % chemical shift of the CEST pool in [ppm]
Pstart=P;
% PLOT Z_cw(P)
[Z ,Rex, Rpw, Rpmt,R1obs]=Z_cw_yaml(P,Psim);
Pref=Psim;
Pref.CESTPool(1).f=0; Pref.CESTPool(2).f=0; Pref.CESTPool(3).f=0; Pref.CESTPool(4).f=0; Pref.CESTPool(5).f=0;
[Zref ,Rex_ref]=Z_cw_yaml(P,Pref);
figure(1),
set(gcf,'Position',[587 162 560 620]);
t = annotation('textbox','String','a)','Position',[0.01 0.85 0.1 0.1]);
t.FontSize = 14; t.LineStyle='None';
t = annotation('textbox','String','b)','Position',[0.01 0.55 0.1 0.1]);
t.FontSize = 14; t.LineStyle='None';
t = annotation('textbox','String','c)','Position',[0.01 0.25 0.1 0.1]);
t.FontSize = 14; t.LineStyle='None';
set(groot,'defaultLineLineWidth',1.2)
subplot(3,1,1),
yyaxis left
% plot(P.xZspec,P.xZspec*0+R1obs,':', 'Displayname','R_{1,obs}') ; hold on;
plot(P.xZspec,Rpw+Rpmt,'--',P.xZspec,Rpw+Rpmt+Rex,'-k') ; hold on;
set(gca,'XDir','reverse'); ylabel('R_{1\rho}(\Delta\omega) [s^{-1}]'); set(gca,'yLim',[0 6]);
yyaxis right
h_rex=plot(P.xZspec,Rex,'-') ; hold on;
set(gca,'XDir','reverse'); ylabel('R_{ex}(\Delta\omega) [s^{-1}]'); set(gca,'yLim',[0 1]);
col_rex=get(h_rex,'Color');
hold on; legend({'R_{1\rho,wmt}','R_{1\rho}=R_{1\rho,wmt}+R_{ex}', 'R_{ex}'},'FontSize',8)
subplot(3,1,2),
plot(P.xZspec,Z,'-k',P.xZspec,Zref,'--') ; hold on;
set(gca,'XDir','reverse'); ylabel('Z(\Delta\omega)'); set(gca,'yLim',[0 1]);
legend({'Z','Z_{ref}'},'FontSize',8)
subplot(3,1,3),
plot(P.xZspec,Zref-Z,'-','Color',col_rex) ; hold on;
set(gca,'XDir','reverse'); xlabel('\Delta\omega [ppm]'); ylabel('MTR_{LD}(\Delta\omega)'); set(gca,'yLim',[0 0.15]);
legend({'MTR_{LD}=Z_{ref}-Z'},'FontSize',8)
figure,
set(gcf,'Position',[587 200 700 400]);
subplot(2,1,1), % vary B1 parameter
vary=[0.25 0.75 2 4 ]; % define value range for variation
for ii=1:numel(vary)
P=Pstart; % reset previous changes
P.B1=vary(ii); % define which parameter you want to vary
% plot(P.xZspec,Z_cw(P),'.-','Color',cl(ii,numel(vary))) ; hold on;
Pref=Psim;
Pref.CESTPool(1).f=0; Pref.CESTPool(2).f=0; Pref.CESTPool(3).f=0; Pref.CESTPool(4).f=0; Pref.CESTPool(5).f=0;
plot(P.xZspec,Z_cw_yaml(P,Pref)-Z_cw_yaml(P,Psim),'-') ; hold on;
end;
set(gca,'XDir','reverse'); xlabel('\Delta\omega [ppm]'); ylabel('MTR_{LD}(\Delta\omega)'); set(gca,'yLim',[0 0.15]);
set(gca,'xLim',[-6 6]);
legend(strsplit(sprintf('B_1 = %.2f µT;',vary),';'),'FontSize',7)
subplot(2,4,5), % vary B1 parameter
%% alpha(B1,B0) verläufe 22feb amide
clear B1 Rexb1 Dilution MTRb1
B1=0.01:0.1:4;
P=Pstart;
for ii=1:numel(B1)
P.B1=B1(ii);
P.xZspec=Psim.CESTPool(1).dw;
Pref=Psim;
Pref.CESTPool(1).f=0; Pref.CESTPool(2).f=0; Pref.CESTPool(3).f=0; Pref.CESTPool(4).f=0; Pref.CESTPool(5).f=0;
[Z ,Rex, Rpw, Rpmt,R1obs]=Z_cw_yaml(P,Psim);
[Zref ,~, Rpwref, Rpmtref]=Z_cw_yaml(P,Pref);
Rexb1(ii)=Rex;
Dilution(ii)= (Zref)^2;
MTRb1(ii)=Zref-Z;
end
co = get(gca,'ColorOrder');
set(gca,'ColorOrder',circshift(co,3,1));
hold all
w1=Psim.Scanner.Gamma*B1;
alpha = w1.^2./(w1.^2+Psim.CESTPool(1).k*(Psim.CESTPool(1).k+Psim.CESTPool(1).R2));
plot(B1,alpha); hold on;
plot(B1,Dilution); hold on;
plot(B1,alpha.*Dilution); hold on;
% plot(B1,MTRb1/(Psim.CESTPool(1).k*Psim.CESTPool(1).f)*R1obs); hold on; % simulated alpha*sigma, but only valid for single CEST pool simulation
legend({'\alpha','\sigma^\prime','\alpha\cdot\sigma^\prime','MTR\cdotR_{1}/k_sf_s'},'FontSize',7)
% Zrefsp = Rex* R1obs/(R1pwmt^2) % with spillover
% Zref = Rex* R1obs/R1obs^2 =Rex/R1obs % without spillover
% spillover term Zrefsp/Zref = R1obs^2/(R1pwmt^2) ~= Zref^2
% alpha from MTRLD: MTRLD = fb*kb*alpha * Zref^2 / R1obs
% alpha * Zref^2 = MTRLD / /fb*kb) *R1obs
% set(gca,'XTicklabels',[]);
% xlabel('RF irradiation amplitude B_1 [µT]');
% ylabel('labeling efficiency');
title('amide at 3.5 ppm');
xlabel('RF amplitude B_1 [µT]');
ylabel('labeling efficiency');
subplot(2,4,6), % vary B1 parameter
%% alpha(B1,B0) verläufe 22feb - guanidine
clear B1 Rexb1 Dilution MTRb1
B1=0.01:0.1:4;
P=Pstart;
for ii=1:numel(B1)
P.B1=B1(ii);
P.xZspec=Psim.CESTPool(2).dw;
Pref=Psim;
Pref.CESTPool(1).f=0; Pref.CESTPool(2).f=0; Pref.CESTPool(3).f=0; Pref.CESTPool(4).f=0; Pref.CESTPool(5).f=0;
[Z ,Rex, Rpw, Rpmt,R1obs]=Z_cw_yaml(P,Psim);
[Zref ,~, Rpwref, Rpmtref]=Z_cw_yaml(P,Pref);
Rexb1(ii)=Rex;
Dilution(ii)= (Zref)^2;
MTRb1(ii)=Zref-Z;
end
co = get(gca,'ColorOrder');
set(gca,'ColorOrder',circshift(co,3,1));
hold all
w1=Psim.Scanner.Gamma*B1;
alpha = w1.^2./(w1.^2+Psim.CESTPool(2).k*(Psim.CESTPool(2).k+Psim.CESTPool(2).R2));
plot(B1,alpha); hold on;
plot(B1,Dilution); hold on;
plot(B1,alpha.*Dilution); hold on;
% plot(B1,MTRb1/(Psim.CESTPool(2).k*Psim.CESTPool(2).f)*R1obs); hold on;
% ylim([0,0.25]);
% legend({'\alpha','\sigma^\prime','\alpha\cdot\sigma^\prime','MTR\cdotR_{1obs}/k_sf_s'},'FontSize',7)
% Zrefsp = Rex* R1obs/(R1pwmt^2) % with spillover
% Zref = Rex* R1obs/R1obs^2 =Rex/R1obs % without spillover
% spillover term Zrefsp/Zref = R1obs^2/(R1pwmt^2) ~= Zref^2
% alpha from MTRLD: MTRLD = fb*kb*alpha * Zref^2 / R1obs
% alpa * Zref^2 = MTRLD / /fb*kb) *R1obs
title('guanidine at 2 ppm');
xlabel('RF amplitude B_1 [µT]');
% ylabel('labeling efficiency');
subplot(2,4,7), % vary B1 parameter
%% alpha(B1,B0) verläufe 22feb - amine
clear B1 Rexb1 Dilution MTRb1
B1=0.01:0.1:4;
P=Pstart;
for ii=1:numel(B1)
P.B1=B1(ii);
P.xZspec=Psim.CESTPool(3).dw;
Pref=Psim;
Pref.CESTPool(1).f=0; Pref.CESTPool(2).f=0; Pref.CESTPool(3).f=0; Pref.CESTPool(4).f=0; Pref.CESTPool(5).f=0;
[Z ,Rex, Rpw, Rpmt,R1obs]=Z_cw_yaml(P,Psim);
[Zref ,~, Rpwref, Rpmtref]=Z_cw_yaml(P,Pref);
Rexb1(ii)=Rex;
Dilution(ii)= (Zref)^2;
MTRb1(ii)=Zref-Z;
end
co = get(gca,'ColorOrder');
set(gca,'ColorOrder',circshift(co,3,1));
hold all
w1=Psim.Scanner.Gamma*B1;
alpha = w1.^2./(w1.^2+Psim.CESTPool(3).k*(Psim.CESTPool(3).k+Psim.CESTPool(3).R2));
plot(B1,alpha); hold on;
plot(B1,Dilution); hold on;
plot(B1,alpha.*Dilution); hold on;
% plot(B1,MTRb1/(Psim.CESTPool(2).k*Psim.CESTPool(2).f)*R1obs); hold on;
% ylim([0,0.25]);
% legend({'\alpha','\sigma^\prime','\alpha\cdot\sigma^\prime','MTR\cdotR_{1obs}/k_sf_s'},'FontSize',7)
% Zrefsp = Rex* R1obs/(R1pwmt^2) % with spillover
% Zref = Rex* R1obs/R1obs^2 =Rex/R1obs % without spillover
% spillover term Zrefsp/Zref = R1obs^2/(R1pwmt^2) ~= Zref^2
% alpha from MTRLD: MTRLD = fb*kb*alpha * Zref^2 / R1obs
% alpa * Zref^2 = MTRLD / /fb*kb) *R1obs
title('amine at 3 ppm');
xlabel('RF amplitude B_1 [µT]');
% ylabel('labeling efficiency');
subplot(2,4,8), % vary B1 parameter
%% alpha(B1,B0) verläufe 22feb - NOE
clear B1 Rexb1 Dilution MTRb1
B1=0.01:0.1:4;
P=Pstart;
for ii=1:numel(B1)
P.B1=B1(ii);
P.xZspec=Psim.CESTPool(5).dw;
Pref=Psim;
Pref.CESTPool(1).f=0; Pref.CESTPool(2).f=0; Pref.CESTPool(3).f=0; Pref.CESTPool(4).f=0; Pref.CESTPool(5).f=0;
[Z ,Rex, Rpw, Rpmt,R1obs]=Z_cw_yaml(P,Psim);
[Zref ,~, Rpwref, Rpmtref]=Z_cw_yaml(P,Pref);
Rexb1(ii)=Rex;
Dilution(ii)= (Zref)^2;
MTRb1(ii)=Zref-Z;
end
co = get(gca,'ColorOrder');
set(gca,'ColorOrder',circshift(co,3,1));
hold all
w1=Psim.Scanner.Gamma*B1;
alpha = w1.^2./(w1.^2+Psim.CESTPool(5).k*(Psim.CESTPool(5).k+Psim.CESTPool(5).R2));
plot(B1,alpha); hold on;
plot(B1,Dilution); hold on;
plot(B1,alpha.*Dilution); hold on;
% plot(B1,MTRb1/(Psim.CESTPool(2).k*Psim.CESTPool(2).f)*R1obs); hold on;
% ylim([0,0.25]);
% legend({'\alpha','\sigma^\prime','\alpha\cdot\sigma^\prime','MTR\cdotR_{1obs}/k_sf_s'},'FontSize',7)
% Zrefsp = Rex* R1obs/(R1pwmt^2) % with spillover
% Zref = Rex* R1obs/R1obs^2 =Rex/R1obs % without spillover
% spillover term Zrefsp/Zref = R1obs^2/(R1pwmt^2) ~= Zref^2
% alpha from MTRLD: MTRLD = fb*kb*alpha * Zref^2 / R1obs
% alpa * Zref^2 = MTRLD / /fb*kb) *R1obs
title('rNOE at -2.75 ppm');
xlabel('RF amplitude B_1 [µT]');
% ylabel('labeling efficiency');
set(findall(gcf,'-property','FontSize'),'FontSize',9)