17 #ifndef _itk_KurtosisFitFunctor_h_
18 #define _itk_KurtosisFitFunctor_h_
24 #include "vnl/vnl_least_squares_function.h"
25 #include "vnl/algo/vnl_levenberg_marquardt.h"
26 #include "vnl/vnl_math.h"
42 itkFactorylessNewMacro(Self)
47 void operator()(vnl_matrix<
double> & newSignal,const vnl_matrix<
double> & SignalMatrix, const
double & S0) override;
49 void setTargetBValue(const
double & targetBValue){m_TargetBvalue = targetBValue;}
50 void setListOfBValues(
const vnl_vector<double> & BValueList){m_BValueList = BValueList;}
64 measurements.set_size(x.size());
65 measurements.copy_in(x.data_block());
70 bValueVector.set_size(x.size());
71 bValueVector.copy_in(x.data_block());
85 vnl_least_squares_function(2 , number_of_measurements, no_gradient)
87 N = get_number_of_residuals();
90 void f(
const vnl_vector<double>& x, vnl_vector<double>& fx)
override {
92 const double & D = x[0];
93 const double & K = x[1];
94 const vnl_vector<double> & b = bValueVector;
96 for(
int s=0; s<N; s++)
98 double approx = S0 * std::exp(- b[s] * D + 1./6. *b[s] * b[s] *D * D * K);
99 fx[s] = vnl_math_abs( measurements[s] - approx );
DWIVoxelFunctor Superclass
The DWIVoxelFunctor class Abstract basisclass for voxelprocessing of Diffusion Weighted Images...
SmartPointer< const Self > ConstPointer
void set_reference_measurement(const double &x)
#define MITKDIFFUSIONCORE_EXPORT
void set_measurements(const vnl_vector< double > &x)
vnl_vector< double > measurements
vnl_vector< double > bValueVector
void f(const vnl_vector< double > &x, vnl_vector< double > &fx) override
SmartPointer< Self > Pointer
The lestSquaresFunction struct for Non-Linear-Least-Squres fit of Kurtosis.
vnl_vector< double > m_BValueList
lestSquaresFunction(unsigned int number_of_measurements)
void setListOfBValues(const vnl_vector< double > &BValueList)
void set_bvalues(const vnl_vector< double > &x)