Variational methods and optimization in imaging