Inheritance diagram for FlowBalloonModel:

The model is driven by blood flow into the venous compartment. This causes the compartment to expand like a balloon, increasing the pressure exerted by it and consequently the blood flow out of the compartment. Concurrently, oxygen extraction, and therefore the rate of dHb production, is more efficient at slower flow rates. These simple interactions simulate a biologically plausible BOLD signal.
, representing normalised dHb content, and
, representing normalised venous volume, are updated according to the system of differential equations given by Buxton et al. (1998):
Other symbols represent biophysical parameters and functions of the system, handled using indii::ml::ode::ParameterCollection and indii::ml::ode::FunctionCollection, with default values given in FlowBalloonModelDefaults.
Singularities are handled using limits. See FlowBalloonModelDefaults::DQDT.
FlowBalloonModel bm; indii::ml::aux::vector y(bm.suggestInitialState());
The model may then be simulated by solving the differential system using indii::ml::ode::AdaptiveRungeKutta:
indii::ml::ode::AdaptiveRungeKutta solver(&bm, y); double end = 60.0; double t = 0.0; while (t < end) { t = solver.step(end); }
In order for the model to do something interesting, however, you will want to at least override the default FlowBalloonModel::F_IN function with your own custom function that controls flow. The following function, for example, generates a flow of 2.0 for 1 s, followed by a constant flow of 1.0:
double F_IN(double t, const double y[], void* o) { if (t < 1.0) { return 2.0; } else { return 1.0; } }
Note the signature of this function, described by indii::ml::ode::f_t. The model can be made to use this function by calling setFunction() before the first call to step():
bm.setFunction(FlowBalloonModel::F_IN, F_IN);
Other biophysical parameters and functions may be customised using the setParameter() and setFunction() methods inherited from indii::ml::ode::ParameterCollection and indii::ml::ode::FunctionCollection.
Finally, you will want to actually retrieve the state of the model after each call to step() using getVariable() or getState(). For example, modifying the loop above:
while (t < end) { t = solver.step(end); std::cout << t << ','; std::cout << solver.getVariable(FlowBalloonModel::Q) << ','; std::cout << solver.getVariable(FlowBalloonModel::V) << std::endl; }
or:
while (t < end) { t = solver.step(end); y = solver.getState(); std::cout << t << ','; std::cout << y(FlowBalloonModel::Q) << ','; std::cout << y(FlowBalloonModel::V) << std::endl; }
The values of biophysical functions, which are time dependent, may be retrieved using getFunction() if they are of interest also.
Definition at line 141 of file FlowBalloonModel.hpp.
Public Types | |
| enum | StateVariable { Q, V } |
| State variable indices. More... | |
| enum | BiophysicalParameter { V_0, E_0, TAU_0, ALPHA } |
| Parameter indices. More... | |
| enum | BiophysicalFunction { F_IN, F_OUT, E } |
| Function indices. More... | |
Public Member Functions | |
| FlowBalloonModel () | |
| Create new model with the default biophysical parameters and functions defined in FlowBalloonModelDefaults. | |
| virtual | ~FlowBalloonModel () |
| Destructor. | |
| virtual indii::ml::aux::vector | suggestInitialState () |
| Provide a suggested initial state. | |
| virtual void | calculateDerivatives (double t, const double y[], double dydt[]) |
| |
| enum StateVariable |
State variable indices.
| Q |
; normalised dHb content of venous compartment at the current time. |
| V |
; normalised volume of the venous compartment at the current time. |
Definition at line 146 of file FlowBalloonModel.hpp.
| enum BiophysicalParameter |
Parameter indices.
Definition at line 163 of file FlowBalloonModel.hpp.
| enum BiophysicalFunction |
Function indices.
| F_IN |
; normalised flow into the venous compartment. |
| F_OUT |
; normalised flow out of the venous compartment. |
| E |
; oxygen extraction rate of the venous compartment. |
Definition at line 190 of file FlowBalloonModel.hpp.
| FlowBalloonModel | ( | ) |
Create new model with the default biophysical parameters and functions defined in FlowBalloonModelDefaults.
Definition at line 15 of file FlowBalloonModel.cpp.
| ~FlowBalloonModel | ( | ) | [virtual] |
| aux::vector suggestInitialState | ( | ) | [virtual] |
Provide a suggested initial state.
This can be passed to the constructor of the ordinary differential equation solver being used on the model, such as indii::ml::ode::AdaptiveRungeKutta.
Implements BalloonModel.
Definition at line 66 of file FlowBalloonModel.cpp.
| void calculateDerivatives | ( | double | t, | |
| const double | y[], | |||
| double | dydt[] | |||
| ) | [virtual] |
1.5.2