Segmenting partially annotated medical images