Much of the image processing that is applied to medical images is a form of "inverse problem". This is a class of mathematical problems in which a "forward" model by which a signal is converted into dataset is known, to at least some degree, but where the aim is to reconstruct the signal given the resulting dataset. Thus, an inverse problem is essentially seeking to discover x given knowledge of A(x)+noise by finding an appropriate reconstruction operator A† such that A†(A(x)+noise) ≈ x, thereby enabling us to obtain x (or a close approximation) given knowledge of an output dataset consisting of A(x)+noise. Generally, several such processes (or their equivalents) are applied to the image dataset. If the first process (for example, noise reduction) is expressed via a first reconstruction operator A1† characterised by a parameter set Θ1, and the second process (for example, segmentation) is expressed via a second reconstruction operator A2† characterised by a parameter set Θ2, then the result of the two steps applied consecutively is A2†(A1†(y)). This can be expressed as an overall reconstruction operator F†, characterised by a parameter set Φ. If we then allow a machine learning process to optimise F†, then the steps previously carried out separately can be combined into a single optimisation. This yields advantages in terms of computational load and in the accuracy of the end result.