The sequence of procedures to segment the epithelial tissue space into theoretical cell profiles. a) original, b) optical density of the Haematoxylin stain after colour deconvolution. c) the epithelial compartment, d) a smoothed version b) after 4 passes of an averaging filter of kernel size 5 pixels, e) morphological basins, f) catchment basins (theoretical cell profiles) after applying the watershed transform, g) average of the negative of e) and f) to show that each "morphological basin" determines a "catchment basin" area. h) logical AND operation of f) and a) to visualise the result of the segmentation. Image i) shows the layers of the tissue labelled as RGB triplets intensity according to their distance from 3 different references (basal layer (red), superficial layer (green) and both layers (blue)).