-
Notifications
You must be signed in to change notification settings - Fork 2
/
e03_1_makeSimMap.m
59 lines (44 loc) · 1.52 KB
/
e03_1_makeSimMap.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
% Simulated scenario with a range of physiological parameters.
% This sceipt simulates curves with a combination of ktrans & ve & vp
% and saves it for future steps
% Estimated runtime: < 1 second
%% Pre-setup
clearvars
addpath('./mfiles')
tic
%% Build map of true values
% Dimensions of map
% (These are actually the other way around in the figure)
nX = 20; % vp and ve
nY = 6; % Ktrans
% Values for parameters
valKt = [0.05,0.15,0.25,0.35,0.45,0.55]; % Ktrans - 6 elements
valVe = repmat([0.1,0.2,0.3,0.4,0.5], 1, 4); % ve - 5 elements, repeat 4 times
valVp = repmat([0.005,0.01,0.05,0.1]', 1, 5)'; % vp - 4 elements, repeat 5 times
% Flatten the vp values (initially matrix because thats how they were defined)
valVp = valVp(:);
% Produce a map of the true values
trueKt = repmat(valKt,[nX 1]);
trueVe = repmat(valVe',[1 nY]);
trueVp = repmat(valVp,[1 nY]);
trueKep = trueKt./trueVe;
%% Simulate the concentration-time curves
initTRes = 0.1; % Initial temporal resolution for simulated data
% Define time
t=initTRes:initTRes:600; % in seconds
t=t'/60; % convert to minutes
% Use literature-based AIF with bolus arrival at 60s
Cp = ParkerAif(t,t(60/initTRes));
% Initialize array
simCt = zeros(length(t),nX,nY);
% Simulate the tissue of interest for each parameter combination
for i=1:nX
for j=1:nY
simCt(:,i,j)=ToftsKety(Cp,[trueKt(i,j) trueKep(i,j) trueVp(i,j)],t,1);
end
end
% Save the simulated data - it'll be used in future steps
save('./data/simMap.mat');
%%
toc
disp('Finished simulating map of perfusion parameters')