00001 #ifndef INDII_FMRI_HEMODYNAMIC_LOGNEURALBALLOONMODEL_HPP 00002 #define INDII_FMRI_HEMODYNAMIC_LOGNEURALBALLOONMODEL_HPP 00003 00004 #include "BalloonModel.hpp" 00005 #include "indii/ml/aux/vector.hpp" 00006 00007 namespace indii { 00008 namespace fmri { 00009 namespace hemodynamic { 00010 00011 /** 00012 * Balloon %model, driven by %neural activity, and working in log 00013 * space. 00014 * 00015 * @author Lawrence Murray <lawrence@indii.org> 00016 * @version $Rev: 285 $ 00017 * @date $Date: 2007-07-20 17:25:40 +0100 (Fri, 20 Jul 2007) $ 00018 * 00019 * This class modifies NeuralBalloonModel so that \f$f\f$, \f$v\f$ and 00020 * \f$q\f$ vary in log space: 00021 * 00022 * @anchor LogNeuralBalloonModel_diffsystem 00023 * \f{eqnarray*} 00024 * \frac{d \ln f}{dt} &=& \frac{\dot{f}}{f} \\ 00025 * \frac{ds}{dt} &=& \dot{s} \\ 00026 * \frac{d \ln q}{dt} &=& \frac{\dot{q}}{q} \\ 00027 * \frac{d \ln v}{dt} &=& \frac{\dot{v}}{v} 00028 * \f} 00029 * 00030 * References to \f$f\f$, \f$q\f$ and \f$v\f$ in biophysical functions 00031 * are substituted with the identities \f$f = e^{\ln f} \f$, \f$q = 00032 * e^{\ln q} \f$ and \f$v = e^{\ln v}\f$. 00033 * 00034 * Working in log space ensures that \f$f\f$, \f$q\f$ and \f$v\f$ are 00035 * always positive. This is particularly important in a stochastic 00036 * setting, where noise may otherwise cause them to become negative, 00037 * such as in the case of the Wiener process or discretised Gaussian 00038 * noise. Introducing such noise into the log space instead ensures 00039 * positivity. 00040 * 00041 * @see FlowBalloonModel for more information on the usage of this 00042 * %model. 00043 */ 00044 class LogNeuralBalloonModel : public BalloonModel { 00045 public: 00046 /** 00047 * State variable indices. 00048 */ 00049 enum StateVariable { 00050 /** 00051 * \f$\ln(q) = \ln\left(\frac{Q(t)}{Q_0}\right)\f$; natural 00052 * logarithm of the normalised dHb content at the current time. 00053 */ 00054 LN_Q, 00055 00056 /** 00057 * \f$\ln(v) = \ln\left(\frac{V(t)}{V_0}\right)\f$; natural 00058 * logarithm of the normalised volume at the current time. 00059 */ 00060 LN_V, 00061 00062 /** 00063 * \f$\ln(f) = \ln\left(\frac{F_{in}(t)}{F_0}\right)\f$; natural 00064 * logarithm of the normalised inflow at the current time. 00065 */ 00066 LN_F, 00067 00068 /** 00069 * \f$s\f$; flow inducing signal. 00070 */ 00071 S 00072 }; 00073 00074 /** 00075 * Parameter indices. These match NeuralBalloonModel for 00076 * consistency. 00077 */ 00078 enum BiophysicalParameter { 00079 /** 00080 * \f$V_0\f$; volume of the venous compartment at rest. 00081 */ 00082 V_0, 00083 00084 /** 00085 * \f$E_0\f$; oxygen extraction rate of the venous compartment at 00086 * rest. 00087 */ 00088 E_0, 00089 00090 /** 00091 * \f$\tau_0 = \frac{V_0}{F_0}\f$; mean transit time through the 00092 * venous compartment at rest. 00093 */ 00094 TAU_0, 00095 00096 /** 00097 * \f$\alpha\f$; Grubb's exponent. 00098 */ 00099 ALPHA, 00100 00101 /** 00102 * \f$\epsilon\f$; efficacy with which neuronal activity causes an 00103 * increase in signal. 00104 */ 00105 EPSILON, 00106 00107 /** 00108 * \f$\frac{1}{\tau_s}\f$; time constant for signal decay. 00109 */ 00110 INV_TAU_S, 00111 00112 /** 00113 * \f$\frac{1}{\tau_f}\f$; time constant for autoregulatory 00114 * feedback from blood flow. 00115 */ 00116 INV_TAU_F 00117 }; 00118 00119 /** 00120 * Function indices. These match NeuralBalloonModel for consistency. 00121 */ 00122 enum BiophysicalFunction { 00123 /** 00124 * \f$f_{in}(t) = \frac{F_{in}(t)}{F_0}\f$; normalised flow into 00125 * the venous compartment. 00126 */ 00127 F_IN, 00128 00129 /** 00130 * \f$f_{out}(t) = \frac{F_{out}(t)}{F_0}\f$; normalised flow out 00131 * of the venous compartment. 00132 */ 00133 F_OUT, 00134 00135 /** 00136 * \f$E(t)\f$; oxygen extraction rate of the venous compartment. 00137 */ 00138 E, 00139 00140 /** 00141 * \f$u(t)\f$; %neural activity. 00142 */ 00143 U 00144 }; 00145 00146 /** 00147 * Create new %model with default biophysical parameters and 00148 * functions as defined in LogNeuralBalloonModelDefaults, 00149 * LogFlowBalloonModelDefaults, NeuralBalloonModelDefaults and 00150 * FlowBalloonModelDefaults. 00151 */ 00152 LogNeuralBalloonModel(); 00153 00154 /** 00155 * Destructor. 00156 */ 00157 virtual ~LogNeuralBalloonModel(); 00158 00159 virtual indii::ml::aux::vector suggestInitialState(); 00160 00161 /** 00162 * @see indii::ml::ode::DifferentialModel 00163 */ 00164 virtual void calculateDerivatives(double t, const double y[], double dydt[]); 00165 00166 private: 00167 /** 00168 * Number of state variables. 00169 */ 00170 static const unsigned int DIMENSIONS = 4; 00171 00172 /** 00173 * Number of parameters. 00174 */ 00175 static const unsigned int NUM_PARAMETERS = 7; 00176 00177 /** 00178 * Number of functions. 00179 */ 00180 static const unsigned int NUM_FUNCTIONS = 4; 00181 00182 }; 00183 00184 } 00185 } 00186 } 00187 00188 #endif
1.5.2