Diffusion MRI is a magnetic resonance imaging (MRI) method producing images of biological tissues weighted with the local characteristics of water diffusion. In our case we are concerned with neural axons of white matter in the brain. Diffusion through this tissue exhibits a strong anisotropic character: since water will diffuse more rapidly in the direction aligned with the internal structure of fibers, and more slowly as it moves perpendicular to the preferred direction. Brain is represented as a set of 3-dimensional cells (voxels). To each voxel and admissible displacement is assigned a probability measured by experimental data. In order to face the problem, we start defining a suitable Hamiltonian function H, strongly related to the draft data given by diffusion MRI. Viscosity solution techniques allows to define a metric related to the solution of the Hamilton-Jacobi equation H(x,Du) = 0 (in similar way the Euclidean distance is related to the Hamilton-Jacobi equation |Du| = 1). In this way we will take into account the anisotropic character of the problem. Finally we employ some results of optimal transport theory (in particular the dynamical formulation of optimal transport problems) to construct a model for this kind of diffusion.