42 #ifndef SVK_2_SITE_EXCHANGE_COST_COST_FUNCTION_H
43 #define SVK_2_SITE_EXCHANGE_COST_COST_FUNCTION_H
70 this->InitNumberOfSignals();
81 double T1all = parameters[0];
82 double Kpl = parameters[1];
89 int arrivalTime = GetArrivalTime( this->GetSignal(0) );
105 for (
int t = 0; t < this->numTimePoints; t++ ) {
107 if (t < arrivalTime ) {
108 this->GetModelSignal(0)[t] = this->GetSignalAtTime(0, t);
109 this->GetModelSignal(1)[t] = this->GetSignalAtTime(1, t);
112 if (t >= arrivalTime ) {
115 this->GetModelSignal(0)[t] = this->GetSignalAtTime(0, arrivalTime)
116 * exp( -((1/T1all) + Kpl) * ( t - arrivalTime) );
119 this->GetModelSignal(1)[t] = this->GetSignalAtTime(1, arrivalTime)
120 * exp( -( t - arrivalTime )/T1all)
121 - this->GetSignalAtTime(0, arrivalTime )
122 * exp( -( t - arrivalTime )/T1all)
123 * ( exp( -Kpl * ( t - arrivalTime )) - 1 );
138 int numParameters = 2;
139 return numParameters;
149 this->SetNumberOfSignals(2);
158 outputDescriptionVector->resize( this->GetNumberOfOutputPorts() );
159 (*outputDescriptionVector)[0] =
"pyr";
160 (*outputDescriptionVector)[1] =
"lac";
161 (*outputDescriptionVector)[2] =
"T1all";
162 (*outputDescriptionVector)[3] =
"Kpl";
172 upperBounds[0] = 50./this->TR;
173 lowerBounds[0] = 8. /this->TR;
175 upperBounds[1] = 0.09 * this->TR;
176 lowerBounds[1] = 0.00 * this->TR;
185 if (this->TR == 0 ) {
186 cout <<
"ERROR: TR Must be set before initializing parameters" << endl;
189 (*initialPosition)[0] = 12 / this->TR;
190 (*initialPosition)[1] = 0.01 * this->TR;
199 if (this->TR == 0 ) {
200 cout <<
"ERROR: TR Must be set before scaling final parameters" << endl;
203 (*finalPosition)[0] *= this->TR;
204 (*finalPosition)[1] /= this->TR;
213 int GetArrivalTime(
float* firstSignal)
const
216 float maxValue0 = firstSignal[0];
219 for(t = arrivalTime; t < this->numTimePoints; t++ ) {
220 if( firstSignal[t] > maxValue0) {
221 maxValue0 = firstSignal[t];
234 #endif// SVK_2_SITE_EXCHANGE_COST_COST_FUNCTION_H
Definition: svkKineticModelCostFunction.h:53
svk2SiteExchangeCostFunction Self
Definition: svk2SiteExchangeCostFunction.h:60
virtual void InitParamBounds(float *lowerBounds, float *upperBounds)
Definition: svk2SiteExchangeCostFunction.h:170
virtual void InitParamInitialPosition(ParametersType *initialPosition)
Definition: svk2SiteExchangeCostFunction.h:183
virtual void GetParamFinalScaledPosition(ParametersType *finalPosition)
Definition: svk2SiteExchangeCostFunction.h:197
virtual unsigned int GetNumberOfParameters(void) const
Definition: svk2SiteExchangeCostFunction.h:136
virtual void InitOutputDescriptionVector(vector< string > *outputDescriptionVector) const
Definition: svk2SiteExchangeCostFunction.h:156
virtual void GetKineticModel(const ParametersType ¶meters) const
Definition: svk2SiteExchangeCostFunction.h:78
svk2SiteExchangeCostFunction()
Definition: svk2SiteExchangeCostFunction.h:67
Superclass::ParametersType ParametersType
Definition: svkKineticModelCostFunction.h:64
Definition: svk2SiteExchangeCostFunction.h:55
virtual void InitNumberOfSignals(void)
Definition: svk2SiteExchangeCostFunction.h:146