Exemplary images visualizing different stages of the analysis. (a) Exemplary 2D binary image. (b) The distance transform (distance from seed points colour-coded from blue to red) computed on the binary image starting from the seed point (yellow) and the resulting longest path (black). (c) Second computed distance transform starting from the first path and the resulting second path connected to the first one (white circle). (d) Final tree structure, ignoring any further small branches.