MCPcopy Create free account
hub / github.com/Image-Py/imagepy / s2r_polygons

Function s2r_polygons

imagepy/core/roi/convert.py:46–55  ·  view source on GitHub ↗
(pg)

Source from the content-addressed store, hash-verified

44 return PolygonRoi([[out, inn]])
45
46def s2r_polygons(pg):
47 from .polygonroi import PolygonRoi
48 body = []
49 for p in pg:
50 if p.exterior == None: continue
51 out = list(p.exterior.coords)
52 inn = [list(i.coords) for i in list(p.interiors)]
53 body.append([out, inn])
54 if len(body)==0:return None
55 return PolygonRoi(body)
56
57def roi2shape(roi):
58 from .lineroi import LineRoi

Callers 1

shape2roiFunction · 0.85

Calls 2

PolygonRoiClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected