25 vnl_vector<double> initalGuess(3);
32 vnl_levenberg_marquardt minimizer(model);
33 minimizer.set_max_function_evals(1000);
34 minimizer.set_f_tolerance(1e-10);
37 for(
unsigned int i = 0 ; i < SignalMatrix.rows(); i++)
39 model.set_measurements(SignalMatrix.get_row(i));
40 model.set_reference_measurement(S0);
42 initalGuess.put(0, 0.f);
43 initalGuess.put(1, 0.009f);
44 initalGuess.put(2, 0.7f);
47 minimizer.minimize_without_gradient(initalGuess);
49 const double & ADC_slow = initalGuess.get(0);
50 const double & ADC_fast = initalGuess.get(1);
51 const double & lambda = initalGuess(2);
54 newSignal.put(i, 1, minimizer.get_end_error());
The lestSquaresFunction struct for Non-Linear-Least-Squres fit of Biexponential model.
vnl_vector< double > m_BValueList
void set_bvalues(const vnl_vector< double > &x)
void operator()(vnl_matrix< double > &newSignal, const vnl_matrix< double > &SignalMatrix, const double &S0) override
operator ()