How to identify, in order, segments?

Hi everyone,

I would like to know if someone have an idea how to identify, in order, each segment of this image ? All of the segments are connected to each othern and i would like to know if there is a way on imageJ to have the identification of ther order of the segment. As example, from left to the right, the first segment, give two other segments, that will givve 8 other segments ….