13 #ifndef MITKTWOTISSUECOMPARTMENTMODELDIFFERENTIALEQUATIONS_H 14 #define MITKTWOTISSUECOMPARTMENTMODELDIFFERENTIALEQUATIONS_H 43 double Ca_t = InterpolateAIFToCurrentTimeStep(t);
45 dxdt[0] = this->K1*Ca_t-(this->k2+this->k3)*x[0] + this->k4*x[1];
46 dxdt[1] = this->k3*x[0] - this->k4*x[1];
54 void initialize(
double k_1,
double k_2,
double k_3,
double k_4)
71 this->m_AIFTimeGrid = grid;
82 AIFType m_AIFTimeGrid;
89 double InterpolateAIFToCurrentTimeStep(
double t)
91 double lastValue = m_AIF[0];
94 AIFType::const_iterator posITime = m_AIFTimeGrid.begin();
95 AIFType::const_iterator posValue = m_AIF.begin();
99 lastValue = *posValue;
100 lastTime = *posITime;
104 double weightLast = 1 - (t - lastTime)/(*posITime - lastTime);
105 double weightNext = 1- (*posITime - t)/(*posITime - lastTime);
106 double result = weightLast * lastValue + weightNext * (*posValue);
114 #endif // MITKTWOTISSUECOMPARTMENTMODELDIFFERENTIALEQUATIONS_H TwoTissueCompartmentModelDifferentialEquations()
void setAIFTimeGrid(AIFType &grid)
void initialize(double k_1, double k_2, double k_3, double k_4)
Initialize class with parameters K1, k2, k3 and k4 that are free fit parameters.
void operator()(const mitk::NumericTwoTissueCompartmentModel::state_type &x, mitk::NumericTwoTissueCompartmentModel::state_type &dxdt, const double t)
Functor for differential equation of Two Tissue Compartment Model Takes current state x = x(t) and ti...
void setAIF(AIFType &aif)
DataCollection - Class to facilitate loading/accessing structured data.
std::vector< double > state_type
Helper Class for NumericTwoTissueCompartment Model: Defines the differential equations (Mass Balance ...
std::vector< double > AIFType