Deep Learning for Medical Image Segmentation using Prior Knowledge and Topology