A convex optimization framework for global tractography