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

Function shape2roi

imagepy/core/roi/convert.py:75–87  ·  view source on GitHub ↗
(shape)

Source from the content-addressed store, hash-verified

73 return r2s_polygon(roi.topolygon())
74
75def shape2roi(shape):
76 if isinstance(shape, Point):
77 return s2r_point(shape)
78 if isinstance(shape, MultiPoint):
79 return s2r_points(shape)
80 if isinstance(shape, LineString):
81 return s2r_line(shape)
82 if isinstance(shape, MultiLineString):
83 return s2r_lines(shape)
84 if isinstance(shape, Polygon):
85 return s2r_polygon(shape)
86 if isinstance(shape, MultiPolygon):
87 return s2r_polygons(shape)
88
89if __name__ == '__main__':
90 import sys

Callers 10

mouse_downMethod · 0.90
mouse_downMethod · 0.90
wkt2roiFunction · 0.85
bufferMethod · 0.85
convexMethod · 0.85
clipMethod · 0.85
invertMethod · 0.85
unionMethod · 0.85
diffMethod · 0.85
affineMethod · 0.85

Calls 6

s2r_pointFunction · 0.85
s2r_pointsFunction · 0.85
s2r_lineFunction · 0.85
s2r_linesFunction · 0.85
s2r_polygonFunction · 0.85
s2r_polygonsFunction · 0.85

Tested by

no test coverage detected