As I said already in prior post, the main part of watershed segmentation is sequential homotopic thinning transformation, “invented” by a group of mathematicians, including F. Meyer (1976), Ch. Lantuejoul (1978), and J.Serra, from Center for Mathematical Morphology, Fontainebleau, France, and published many times, including different modifications and implementations, such as “SKIZ”, watersheds by flooding, watersheds by hierarchical queues and markers-controlled watersheds. Present modification (see Fig.1 below) was created for for one particular group of Cold Spring Harbor Laboratory (Long Island, NY). Described implementation is based on MAMBA-Image library, developed by S. and N. Beusher.
Fig. 1: Block-diagram of developed segmentation procedure.
Fig.2: Main steps of the segmentation procedure.
Mamba-Image is the most comprehensive open-source Mathematical Morphology library written in C and Python. The library is exceptionally well-documented; it also includes numerous code examples for beginners as well as many publication references for advanced users.
Below is Pyhon source code in Jupyter Notebook format. You can download it using this link: Source Code