4 #include <itkSymmetricEigenAnalysis.h> 19 * m_GradientEigenvector1 * m_GradientEigenvector1));
33 - gradient[2] * std::sin(this->
GetOrientationTheta())) * m_GradientEigenvector1 * signalAttenuation;
39 * m_GradientEigenvector1 * signalAttenuation;
41 if (m_EstimateDiffusivities)
44 m_JacobianVector[2] = - bValue * m_GradientEigenvector1 * m_GradientEigenvector1 * signalAttenuation;
47 m_JacobianVector[3] = - bValue * signalAttenuation;
81 if (m_EstimateDiffusivities)
95 if (m_EstimateDiffusivities)
109 if (m_EstimateDiffusivities)
125 if (m_EstimateDiffusivities)
136 if (m_EstimateDiffusivities == arg)
139 m_EstimateDiffusivities = arg;
140 m_ChangedConstraints =
true;
146 itkExceptionMacro(
"The input vector size does not match the size of the compartment");
152 unsigned int pos = 0;
155 for (
unsigned int j = 0;j <= i;++j)
157 tensor(i,j) = compartmentVector[pos];
160 tensor(j,i) = compartmentVector[pos];
166 eigSys.ComputeEigenValuesAndVectors(tensor,eVals,eVecs);
171 compartmentOrientation[i] = eVecs(2,i);
188 if (!m_ChangedConstraints)
189 return m_NumberOfParameters;
194 if (!m_EstimateDiffusivities)
195 m_NumberOfParameters -= 2;
197 m_ChangedConstraints =
false;
198 return m_NumberOfParameters;
209 unsigned int pos = 0;
212 for (
unsigned int j = 0;j <= i;++j)
251 double numFA = std::sqrt (2.0 * (l1 - l2) * (l1 - l2));
252 double denomFA = std::sqrt (l1 * l1 + 2.0 * l2 * l2);
256 fa = std::sqrt(0.5) * (numFA / denomFA);
266 return (l1 + 2.0 * l2) / 3.0;
const double MCMZeroLowerBound
Default zero lower bound (in case we want something else than zero one day)
double GetApparentPerpendicularDiffusivity() ITK_OVERRIDE
Get approximation to perpendicular diffusivity of the compartment (may be different from radial diffu...
double GetApparentParallelDiffusivity() ITK_OVERRIDE
Get approximation to parallel diffusivity of the compartment (may be different from axial diffusivity...
std::vector< double > ListType
void TransformSphericalToCartesianCoordinates(const VectorType &v, VectorType &resVec)
virtual void SetAxialDiffusivity(double num)
ListType m_ParametersLowerBoundsVector
Vector holding current parameters lower bounds.
Superclass::ModelOutputVectorType ModelOutputVectorType
virtual ListType & GetSignalAttenuationJacobian(double smallDelta, double bigDelta, double gradientStrength, const Vector3DType &gradient) ITK_OVERRIDE
unsigned int GetNumberOfParameters() ITK_OVERRIDE
Number of optimized parameters: smaller than total number of parameters.
const double MCMAzimuthAngleUpperBound
Azimuth angle upper bound.
virtual void SetRadialDiffusivity2(double num)
unsigned int GetCompartmentSize() ITK_OVERRIDE
Number of parameters to describe the model, these parameters will be self-contained, i.e. include fixed parameters for example.
virtual double GetOrientationPhi()
void SetRadialDiffusivity1(double num) ITK_OVERRIDE
virtual void SetRadialDiffusivity1(double num)
virtual void SetParametersFromVector(const ListType ¶ms) ITK_OVERRIDE
Various methods for optimization parameters setting and getting.
virtual double GetLogDiffusionProfile(const Vector3DType &sample) ITK_OVERRIDE
virtual double GetFourierTransformedDiffusionProfile(double smallDelta, double bigDelta, double gradientStrength, const Vector3DType &gradient) ITK_OVERRIDE
const Matrix3DType & GetDiffusionTensor() ITK_OVERRIDE
Get compartment as a 3D tensor (default behavior: throw exception if not supported by the compartment...
virtual double GetAxialDiffusivity()
void SetCompartmentVector(ModelOutputVectorType &compartmentVector) ITK_OVERRIDE
Set compartment overall description vector, for setting automatically the individual parameters when ...
const double MCMRadialDiffusivityUpperBound
Radial diffusivity upper bound.
ListType m_ParametersVector
Vector holding current parameters vector.
double GetBValueFromAcquisitionParameters(double smallDelta, double bigDelta, double gradientStrength)
Given gyromagnetic ratio in rad/s/T, gradient strength in T/mm and deltas in s, computes b-value in s...
virtual double GetOrientationTheta()
const double MCMPolarAngleUpperBound
Polar angle upper bound (used in tensor for now)
virtual ListType & GetParameterLowerBounds() ITK_OVERRIDE
virtual void SetOrientationTheta(double num)
ListType m_ParametersUpperBoundsVector
Vector holding current parameters upper bounds.
virtual ListType & GetParameterUpperBounds() ITK_OVERRIDE
Superclass::Matrix3DType Matrix3DType
ListType m_JacobianVector
Vector holding current jacobian value.
const double MCMDiffusivityUpperBound
Diffusivity upper bound.
virtual double GetRadialDiffusivity1()
double ComputeScalarProduct(const VectorType &v1, const VectorType &v2, const unsigned int NDimension)
virtual void SetOrientationPhi(double num)
const double MCMDiffusivityLowerBound
Diffusivity lower bound for estimation.
double GetApparentFractionalAnisotropy() ITK_OVERRIDE
void SetEstimateDiffusivities(bool arg)
Matrix3DType m_DiffusionTensor
Matrix to hold working value of diffusion tensor approximation to the model.
Superclass::Vector3DType Vector3DType
void TransformCartesianToSphericalCoordinates(const VectorType &v, VectorType &resVec)
ModelOutputVectorType m_CompartmentVector
Vector to hold working value of compartment vector.
static const unsigned int m_SpaceDimension
double GetApparentMeanDiffusivity() ITK_OVERRIDE
const double MCMAxialDiffusivityAddonLowerBound
Axial diffusivity add on to lower bound (used to ensure a minimal anisotropy to the anisotropic compa...
ModelOutputVectorType & GetCompartmentVector() ITK_OVERRIDE
Get compartment overall description vector, mainly for writing, should be self-contained.
virtual ListType & GetParametersAsVector() ITK_OVERRIDE