4 #include <itkSymmetricEigenAnalysis.h> 18 * m_GradientEigenvector1 * m_GradientEigenvector1));
32 - gradient[2] * std::sin(this->
GetOrientationTheta())) * m_GradientEigenvector1 * signalAttenuation;
37 * m_GradientEigenvector1 * signalAttenuation;
39 if (m_EstimateAxialDiffusivity)
42 m_JacobianVector[2] = -bValue * m_GradientEigenvector1 * m_GradientEigenvector1 * signalAttenuation;
70 if (m_EstimateAxialDiffusivity)
81 if (m_EstimateAxialDiffusivity)
92 if (m_EstimateAxialDiffusivity)
105 if (m_EstimateAxialDiffusivity)
113 if (m_EstimateAxialDiffusivity == arg)
116 m_EstimateAxialDiffusivity = arg;
117 m_ChangedConstraints =
true;
123 itkExceptionMacro(
"The input vector size does not match the size of the compartment");
129 unsigned int pos = 0;
132 for (
unsigned int j = 0;j <= i;++j)
134 tensor(i,j) = compartmentVector[pos];
137 tensor(j,i) = compartmentVector[pos];
143 eigSys.ComputeEigenValuesAndVectors(tensor,eVals,eVecs);
148 compartmentOrientation[i] = eVecs(2,i);
165 if (!m_ChangedConstraints)
166 return m_NumberOfParameters;
169 m_NumberOfParameters = 3;
171 if (!m_EstimateAxialDiffusivity)
172 --m_NumberOfParameters;
174 m_ChangedConstraints =
false;
175 return m_NumberOfParameters;
186 unsigned int pos = 0;
189 for (
unsigned int j = 0;j <= i;++j)
228 double numFA = std::sqrt (2.0 * (l1 - l2) * (l1 - l2));
229 double denomFA = std::sqrt (l1 * l1 + 2.0 * l2 * l2);
233 fa = std::sqrt(0.5) * (numFA / denomFA);
243 return (l1 + 2.0 * l2) / 3.0;
double GetApparentPerpendicularDiffusivity() ITK_OVERRIDE
Get approximation to perpendicular diffusivity of the compartment (may be different from radial diffu...
const double MCMZeroLowerBound
Default zero lower bound (in case we want something else than zero one day)
virtual ListType & GetParametersAsVector() ITK_OVERRIDE
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.
unsigned int GetNumberOfParameters() ITK_OVERRIDE
Number of optimized parameters: smaller than total number of parameters.
const double MCMAzimuthAngleUpperBound
Azimuth angle upper bound.
void SetCompartmentVector(ModelOutputVectorType &compartmentVector) ITK_OVERRIDE
Set compartment overall description vector, for setting automatically the individual parameters when ...
virtual ListType & GetParameterUpperBounds() ITK_OVERRIDE
virtual double GetLogDiffusionProfile(const Vector3DType &sample) ITK_OVERRIDE
ModelOutputVectorType & GetCompartmentVector() ITK_OVERRIDE
Get compartment overall description vector, mainly for writing, should be self-contained.
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()
virtual void SetRadialDiffusivity1(double num)
virtual ListType & GetParameterLowerBounds() 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()
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)
Superclass::Matrix3DType Matrix3DType
virtual void SetOrientationTheta(double num)
ListType m_ParametersUpperBoundsVector
Vector holding current parameters upper bounds.
virtual double GetFourierTransformedDiffusionProfile(double smallDelta, double bigDelta, double gradientStrength, const Vector3DType &gradient) ITK_OVERRIDE
ListType m_JacobianVector
Vector holding current jacobian value.
const double MCMDiffusivityUpperBound
Diffusivity upper bound.
virtual double GetRadialDiffusivity1()
void SetEstimateAxialDiffusivity(bool arg)
double ComputeScalarProduct(const VectorType &v1, const VectorType &v2, const unsigned int NDimension)
virtual void SetOrientationPhi(double num)
double GetApparentMeanDiffusivity() ITK_OVERRIDE
Superclass::ModelOutputVectorType ModelOutputVectorType
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.
double GetApparentFractionalAnisotropy() ITK_OVERRIDE
static const unsigned int m_SpaceDimension
virtual void SetParametersFromVector(const ListType ¶ms) ITK_OVERRIDE
Various methods for optimization parameters setting and getting.
const double MCMAxialDiffusivityAddonLowerBound
Axial diffusivity add on to lower bound (used to ensure a minimal anisotropy to the anisotropic compa...
double GetApparentParallelDiffusivity() ITK_OVERRIDE
Get approximation to parallel diffusivity of the compartment (may be different from axial diffusivity...
virtual ListType & GetSignalAttenuationJacobian(double smallDelta, double bigDelta, double gradientStrength, const Vector3DType &gradient) ITK_OVERRIDE