We have a lot of work of annotations done using the Polyline tool instead of the Polygon tool. Both seem to implement a list of vertices, just that polygons are closed and correctly get exported during another later step. Is there a way to write a script that would convert polyline annotations to a polygon type while maintaining the label? I know the overall sketch is something like:
annots = getAnnotationsObjects() # Loop over all, check if polyline x,y = annot.getVerticies label = annot.getClassLabel() new roi = new PolygonROI(x,y, label) addObject(roi) deleteObject(annot)
But for the life of me I cannot figure out how to do this in groovy…I’m new to scripting with qupath. Hopefully someone can help!