# Quantitiative Diffusion Measures

Given the eigenvalues $latex \lambda_1, \lambda_2, \lambda_3$ and eigenvectors $latex v_1, v_2, v_3$ one can define many metrics.

### Fractional anisotropy

Given a set of three eigenvalues $latex \lambda_1, \lambda_2, \lambda_3$  (variable ‘evalues’ in Matlab) the fractional anisotropy (FA) is calculated as:

$latex FA = \frac{ \left(\lambda_1 – \lambda_2\right)^2+ \left( \lambda_1 – \lambda_3\right)^2 + \left( \lambda_2 – \lambda_3\right)^2}{2\left( \lambda_1^2 + \lambda_2^2 + \lambda_3^2 \right)}$

which can be calculated using the following Matlab code:

[cc lang="matlab"]

sum_sq_evalues = sum(evalues.^2);

sde = (evalues(1)-evalues(2))^2 + (evalues(2)-evalues(3))^2 + (evalues(1)-evalues(3))^2;
fa = sqrt( sde / (2*sum_sq_evalues) );

[/cc]

For this, it doesn’t matter that the eigenvalues are sorted, though typically they are sorted from highest to lowest.