1. A method of producing a scalar image from a derivative field and a vector image, the derivative field being calculated or derived from the vector image, the method including the steps of: a) retrieving, by a processing unit of at least one computing device, a function class c from a data store, wherein all members of the class c are a finite number of prepopulated functions which map each vector of the vector image to a unique scalar value; b) selecting, by the processing unit of the at least one computing device, a function f from the class c which maps the vector image to a scalar image, a derivative field of the function f being closest to the derivative field from amongst derivative fields of other members of the function class c; and c) generating, by the processing unit of the at least one computing device, the scalar image from the vector image by using the function f to calculate each scalar value in the scalar image from a corresponding vector in the vector image, wherein the calculation of each scalar value is performed without solving Poisson's equation.