Changed interface to convert polygons to masks