Applying morphological closing operation to get rid of tiny holes in binary masks that lead to spurious loops and branches in skeleton (works better than setting the trim option in voronoiSkel