  Blood vessel segmentation is one of the most studied topics in computer
vision, due to its relevance in daily clinical practice. Despite the evolution
the field has been facing, especially after the dawn of deep learning,
important challenges are still not solved. One of them concerns the consistency
of the topological properties of the vascular trees, given that the best
performing methodologies do not directly penalize mistakes such as broken
segments and end up producing predictions with disconnected trees. This is
particularly relevant in graph-like structures, such as blood vessel trees,
given that it puts at risk the characterization steps that follow the
segmentation task. In this paper, we propose a similarity index which captures
the topological consistency of the predicted segmentations having as reference
the ground truth. We also design a novel loss function based on the
morphological closing operator and show how it allows to learn deep neural
network models which produce more topologically coherent masks. Our experiments
target well known retinal benchmarks and a coronary angiogram database.
