Segmentation of medical devices