1. A computer-implemented method of processing an image, the method comprising: receiving an image to be processed; obtaining details of a seed region in the image; and creating, by at least one processor, a data structure holding a tree-based representation of the image which is related to geodesic distances of image elements in the image from the seed region; wherein the data structure comprises a direction for each image element location, that direction being a direction along a branch in the tree-based representation.