Coregistration and segmentation of digital images based on the minimization of a functional by the numerical solution of a set of differential equations