% schabel test

clear all
close all

% simulation time
t = -1:.01:3; % min

% some  parameters in order to
% reproduce figure 1 from 
% Schabel, A Unified Impulse Resposne Model for DCE-MRI, MRM, 68:(2012)
tc = 6/60; % min
alfa = 10;
E  = 0.5;  % ejection fraction 0<vp<1
kep = 2;  % volume fraction 0<vp<1
F = 1; % mmol/L
p = [tc,alfa,E,kep,F];
[c,rv,rp] = schabel(p,t);
figure
plot(60*t(find(t<.5)),[rv(find(t<.5))' rp(find(t<.5))' rv(find(t<.5))'+rp(find(t<.5))'],'.-')
title('Impulsive Response R_p and R_v')

% =============================================================================
% some example curves
% from figure 6 in 
% Schabel, A Unified Impulse Resposne Model for DCE-MRI, MRM, 68:(2012)

% glioblastoma multiforme
tc = 11.8/60; % [min]
alfa = 1/0.67;
E = 0.161;
kep = 0.013/0.076;%Ktrans/ve
F = 0.087; % [mL/mL/min]
alfa = 1./(0.01:.2:1);
for k = 1:length(alfa)
	p = [tc,alfa(k),E,kep,F];
	[c(:,k)] = schabel(p,t);
end
figure
plot(t,c)
title('glioblastoma multiforme')
xlabel('time  [min]')
ylabel('C_t(t) [mmol/L]')


% anaplstic meningioma
tc = 24.4/60; % [min]
alfa = 1/0.78;
E = 0.19;
kep = 0.031/0.206;%Ktrans/ve
F = 0.166; % [mL/mL/min]
alfa = 1./[0.01 0.1 0.25 0.5 1];
for k = 1:length(alfa)
	p = [tc,alfa(k),E,kep,F];
	[c(:,k)] = schabel(p,t);
end
figure
plot(t,c,'-')
title('anaplstic meningioma')
xlabel('time  [min]')
ylabel('C_t(t) [mmol/L]')


