-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspm_gx_hdm.m
87 lines (73 loc) · 3.09 KB
/
spm_gx_hdm.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
function [y] = spm_gx_hdm(x,u,P,M)
% Simulated BOLD response to input.
% FORMAT [y] = spm_gx_hdm(x,u,P,M)
% y - BOLD response (%)
% x - state vector (see spm_fx_fmri)
% P - Parameter vector (see spm_fx_fmri)
%__________________________________________________________________________
%
% This function implements the BOLD signal model described in:
%
% Stephan KE, Weiskopf N, Drysdale PM, Robinson PA, Friston KJ (2007)
% Comparing hemodynamic models with DCM. NeuroImage 38: 387-401.
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
% Karl Friston & Klaas Enno Stephan
% $Id: spm_gx_hdm.m 6856 2016-08-10 17:55:05Z karl $
% biophysical constants for 1.5 T:
%==========================================================================
% hemodynamic parameters
%--------------------------------------------------------------------------
% H(1) - signal decay d(ds/dt)/ds)
% H(2) - autoregulation d(ds/dt)/df)
% H(3) - transit time (t0)
% H(4) - exponent for Fout(v) (alpha)
% H(5) - resting oxygen extraction (E0)
% H(6) - ratio of intra- to extra-vascular components (epsilon)
%--------------------------------------------------------------------------
if isstruct(P)
H = [0.64 0.32 2.00 0.32 0.4];
for i = 1:numel(P.decay)
H(6) = P.epsilon;
y(i,1) = spm_gx_hdm(x(i,:),u(i),H,M);
end
return
end
% echo time (seconds)
%--------------------------------------------------------------------------
try
TE = M(1).TE;
catch
TE = 0.04;
end
% resting venous volume
%--------------------------------------------------------------------------
V0 = 100*0.08;
% slope r0 of intravascular relaxation rate R_iv as a function of oxygen
% saturation Y: R_iv = r0*[(1-Y)-(1-Y0)]
%--------------------------------------------------------------------------
r0 = 25;
% frequency offset at the outer surface of magnetized vessels
%--------------------------------------------------------------------------
nu0 = 40.3;
% region-specific resting oxygen extraction fractions
%--------------------------------------------------------------------------
E0 = P(5);
% region-specific ratios of intra- to extravascular components of
% the gradient echo signal (prior mean = 1, log-normally distributed
% scaling factor)
%--------------------------------------------------------------------------
epsi = exp(P(6));
% coefficients in BOLD signal model
%--------------------------------------------------------------------------
k1 = 4.3.*nu0.*E0.*TE;
k2 = epsi.*r0.*E0.*TE;
k3 = 1 - epsi;
% exponentiation of hemodynamic state variables
%--------------------------------------------------------------------------
x = exp(x);
% BOLD signal
%--------------------------------------------------------------------------
v = x(3);
q = x(4);
y = V0*(k1.*(1 - q) + k2.*(1 - (q./v)) + k3.*(1 - v));