indii/fmri/hemodynamic/LogFlowBalloonModel.hpp

00001 #ifndef INDII_FMRI_HEMODYNAMIC_LOGFLOWBALLOONMODEL_HPP
00002 #define INDII_FMRI_HEMODYNAMIC_LOGFLOWBALLOONMODEL_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 blood flow, and working in log space.
00013  *
00014  * @author Lawrence Murray <lawrence@indii.org>
00015  * @version $Rev: 285 $
00016  * @date $Date: 2007-07-20 17:25:40 +0100 (Fri, 20 Jul 2007) $
00017  *
00018  * This class modifies FlowBalloonModel so that \f$v\f$ and \f$q\f$
00019  * vary in log space as:
00020  *
00021  * @anchor LogFlowBalloonModel_diffsystem
00022  * \f{eqnarray*}
00023  *   \frac{d \ln q}{dt} &=& \frac{\dot{q}}{q} \\
00024  *   \frac{d \ln v}{dt} &=& \frac{\dot{v}}{v}
00025  * \f}
00026  *
00027  * References to \f$q\f$ and \f$v\f$ in biophysical functions are
00028  * substituted with the identities \f$q = e^{\ln q} \f$ and \f$v =
00029  * e^{\ln v}\f$.
00030  *
00031  * Working in log space ensures that \f$q\f$ and \f$v\f$ are always
00032  * positive. This is particularly important in a stochastic setting,
00033  * where noise may otherwise cause them to become negative, such as in
00034  * the case of the Wiener process or discretised Gaussian
00035  * noise. Introducing such noise into the log space instead ensures
00036  * positivity.
00037  *
00038  * @see FlowBalloonModel for more information on the usage of this
00039  * %model.
00040  */
00041 class LogFlowBalloonModel : public BalloonModel {
00042 public:
00043   /**
00044    * State variables.
00045    */
00046   enum StateVariable {
00047     /**
00048      * \f$\ln(q) = \ln\left(\frac{Q(t)}{Q_0}\right)\f$; natural
00049      * logarithm of the normalised dHb content at the current time.
00050      */
00051     LN_Q,
00052 
00053     /**
00054      * \f$\ln(v) = \ln\left(\frac{V(t)}{V_0}\right)\f$; natural
00055      * logarithm of the normalised volume at the current time.
00056      */
00057     LN_V
00058   };
00059 
00060   /**
00061    * Parameter indices. These match those of FlowBalloonModel for
00062    * consistency.
00063    */
00064   enum BiophysicalParameter {
00065     /**
00066      * \f$V_0\f$; volume of the venous compartment at rest.
00067      */
00068     V_0,
00069   
00070     /**
00071      * \f$E_0\f$; oxygen extraction rate of the venous compartment at
00072      * rest.
00073      */
00074     E_0,
00075 
00076     /**
00077      * \f$\tau_0 = \frac{V_0}{F_0}\f$; mean transit time through the
00078      * venous compartment at rest.
00079      */
00080     TAU_0,
00081 
00082     /**
00083      * \f$\alpha\f$; Grubb's exponent.
00084      */
00085     ALPHA
00086   };
00087 
00088   /**
00089    * Function indices. These match those of FlowBalloonModel for
00090    * consistency.
00091    */
00092   enum BiophysicalFunction {
00093     /**
00094      * \f$f_{in}(t) = \frac{F_{in}(t)}{F_0}\f$; normalised flow into
00095      * the venous compartment.
00096      */
00097     F_IN,
00098 
00099     /**
00100      * \f$f_{out}(t) = \frac{F_{out}(t)}{F_0}\f$; normalised flow out
00101      * of the venous compartment.
00102      */
00103     F_OUT,
00104 
00105     /**
00106      * \f$E(t)\f$; oxygen extraction rate of the venous compartment.
00107      */
00108     E
00109   };
00110 
00111   /**
00112    * Create new %model with default biophysical parameters and
00113    * functions as defined in LogFlowBalloonModelDefaults and
00114    * FlowBalloonModelDefaults.
00115    */
00116   LogFlowBalloonModel();
00117 
00118   /**
00119    * Destructor.
00120    */
00121   virtual ~LogFlowBalloonModel();
00122 
00123   virtual indii::ml::aux::vector suggestInitialState();
00124 
00125   /**
00126    * @see indii::ml::ode::DifferentialModel
00127    */
00128   virtual void calculateDerivatives(double t, const double y[], double dydt[]);
00129 
00130 private:
00131   /**
00132    * Number of state variables.
00133    */
00134   static const unsigned int DIMENSIONS = 2;
00135 
00136   /**
00137    * Number of parameters.
00138    */
00139   static const unsigned int NUM_PARAMETERS = 4;
00140 
00141   /**
00142    * Number of functions.
00143    */
00144   static const unsigned int NUM_FUNCTIONS = 3;
00145 
00146 };
00147 
00148     }
00149   }
00150 }
00151 
00152 #endif

Generated on Tue Oct 9 22:02:07 2007 for fmrii fMRI Modelling Library by  doxygen 1.5.2