Robust contour based surface reconstruction algorithms for applications in medical imaging