13 return std::abs(ftDiffusionProfile);
24 for (
unsigned int i = 0;i < Matrix3DType::RowDimensions;++i)
26 for (
unsigned int j = i;j < Matrix3DType::ColumnDimensions;++j)
28 double diffValue = std::abs(lhsTensor(i,j) - rhsTensor(i,j));
29 double denom = std::max(std::abs(lhsTensor(i,j)),std::abs(rhsTensor(i,j)));
32 if ((diffValue / denom > tolerance) && (diffValue > absoluteTolerance))
42 if ((diffValue / denomValue > tolerance) && (diffValue > absoluteTolerance))
55 if ((diffValue / denomValue > tolerance) && (diffValue > absoluteTolerance))
60 if ((diffValue / denomValue > tolerance) && (diffValue > absoluteTolerance))
65 if ((diffValue / denomValue > tolerance) && (diffValue > absoluteTolerance))
70 if ((diffValue / denomValue > tolerance) && (diffValue > absoluteTolerance))
75 if ((diffValue / denomValue > tolerance) && (diffValue > absoluteTolerance))
80 if ((diffValue / denomValue > tolerance) && (diffValue > absoluteTolerance))
106 unsigned int imageDimension = tmpDir.size();
107 for (
unsigned int k = 0;k < imageDimension;++k)
109 tmpRotatedDir[k] = 0;
111 for (
unsigned int l = 0;l < imageDimension;++l)
112 tmpRotatedDir[k] += orientationMatrix(l,k) * tmpDir[l];
122 throw itk::ExceptionObject(__FILE__,__LINE__,
"This compartment type does not support diffusion tensor export",ITK_LOCATION);
127 throw itk::ExceptionObject(__FILE__,__LINE__,
"This compartment type does not support apparent fractional anisotropy computation",ITK_LOCATION);
132 throw itk::ExceptionObject(__FILE__,__LINE__,
"This compartment type does not support apparent mean diffusivity computation",ITK_LOCATION);
137 throw itk::ExceptionObject(__FILE__,__LINE__,
"This compartment type does not support apparent parallel diffusivity computation",ITK_LOCATION);
142 throw itk::ExceptionObject(__FILE__,__LINE__,
"This compartment type does not support apparent perpendicular diffusivity computation",ITK_LOCATION);
virtual bool GetTensorCompatible()
virtual double GetApparentFractionalAnisotropy()
void TransformSphericalToCartesianCoordinates(const VectorType &v, VectorType &resVec)
virtual void SetAxialDiffusivity(double num)
virtual void SetRadialDiffusivity2(double num)
virtual void SetTissueRadius(double num)
virtual bool IsEqual(Self *rhs, double tolerance=1.0e-2, double absoluteTolerance=1.0e-8)
Tests equality to another compartment up to a constant (relative and absolute tolerances) ...
virtual double GetOrientationPhi()
virtual void SetRadialDiffusivity1(double num)
itk::Matrix< double, 3, 3 > Matrix3DType
virtual double GetApparentMeanDiffusivity()
vnl_vector_fixed< double, 3 > Vector3DType
virtual void SetPerpendicularAngle(double num)
virtual double GetAxialDiffusivity()
virtual double GetApparentPerpendicularDiffusivity()
Get approximation to perpendicular diffusivity of the compartment (may be different from radial diffu...
virtual double GetPerpendicularAngle()
virtual double GetOrientationTheta()
virtual void SetOrientationConcentration(double num)
virtual void SetExtraAxonalFraction(double num)
virtual double GetExtraAxonalFraction()
virtual void SetOrientationTheta(double num)
virtual const Matrix3DType & GetDiffusionTensor()
Get compartment as a 3D tensor (default behavior: throw exception if not supported by the compartment...
virtual double GetFourierTransformedDiffusionProfile(double smallDelta, double bigDelta, double gradientStrength, const Vector3DType &gradient)=0
virtual double GetRadialDiffusivity2()
virtual void CopyFromOther(Self *rhs)
Copy internal parameters from another compartment, faster than a set/get compartment vector...
virtual double GetRadialDiffusivity1()
double ComputeScalarProduct(const VectorType &v1, const VectorType &v2, const unsigned int NDimension)
virtual void SetOrientationPhi(double num)
virtual double GetTissueRadius()
virtual double GetApparentParallelDiffusivity()
Get approximation to parallel diffusivity of the compartment (may be different from axial diffusivity...
double GetPredictedSignal(double smallDelta, double bigDelta, double gradientStrength, const Vector3DType &gradient)
virtual void Reorient(vnl_matrix< double > &orientationMatrix, bool affineTransform)
Reorient the fascicle compartment using a matrix, the flag specifies if the transform is affine or ri...
void TransformCartesianToSphericalCoordinates(const VectorType &v, VectorType &resVec)
virtual double GetOrientationConcentration()