17 #ifndef _itk_ADCFitFunctor_h_
18 #define _itk_ADCFitFunctor_h_
21 #include "vnl/vnl_least_squares_function.h"
22 #include "vnl/vnl_math.h"
37 itkFactorylessNewMacro(Self)
42 void operator()(vnl_matrix<
double> & newSignal, const vnl_matrix<
double> & SignalMatrix, const
double & S0) override;
44 void setTargetBValue(const
double & targetBValue){m_TargetBvalue = targetBValue;}
45 void setListOfBValues(
const vnl_vector<double> & BValueList){m_BValueList = BValueList;}
59 measurements.set_size(x.size());
60 measurements.copy_in(x.data_block());
65 bValueVector.set_size(x.size());
66 bValueVector.copy_in(x.data_block());
80 vnl_least_squares_function(1 , number_of_measurements, no_gradient)
82 N = get_number_of_residuals();
85 void f(
const vnl_vector<double>& x, vnl_vector<double>& fx)
override {
87 const double & ADC = x[0];
89 const vnl_vector<double> & b = bValueVector;
91 for(
int s=0; s<N; s++)
93 double approx = S0 * std::exp(-b[s] * ADC);
94 fx[s] = vnl_math_abs( measurements[s] - approx );
The DWIVoxelFunctor class Abstract basisclass for voxelprocessing of Diffusion Weighted Images...
vnl_vector< double > m_BValueList
SmartPointer< const Self > ConstPointer
#define MITKDIFFUSIONCORE_EXPORT
vnl_vector< double > measurements
void setListOfBValues(const vnl_vector< double > &BValueList)
lestSquaresFunction(unsigned int number_of_measurements)
void set_reference_measurement(const double &x)
vnl_vector< double > bValueVector
void f(const vnl_vector< double > &x, vnl_vector< double > &fx) override
The lestSquaresFunction struct for Non-Linear-Least-Squres fit of monoexponential model...
void set_measurements(const vnl_vector< double > &x)
SmartPointer< Self > Pointer
DWIVoxelFunctor Superclass
void set_bvalues(const vnl_vector< double > &x)