  The categorical distribution is a natural representation of uncertainty in
multi-class segmentations. In the two-class case the categorical distribution
reduces to the Bernoulli distribution, for which grayscale morphology provides
a range of useful operations. In the general case, applying morphological
operations on uncertain multi-class segmentations is not straightforward as an
image of categorical distributions is not a complete lattice. Although
morphology on color images has received wide attention, this is not so for
color-coded or categorical images and even less so for images of categorical
distributions. In this work, we establish a set of requirements for morphology
on categorical distributions by combining classic morphology with a
probabilistic view. We then define operators respecting these requirements,
introduce protected operations on categorical distributions and illustrate the
utility of these operators on two example tasks: modeling annotator bias in
brain tumor segmentations and segmenting vesicle instances from the predictions
of a multi-class U-Net.
