Fixed mismatched coordinate system in contour analysis function