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

Method get_rect

imagepy/core/wraper/imageplus.py:88–93  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

86 return self.msk
87
88 def get_rect(self):
89 if self.roi==None:return slice(None), slice(None)
90 box = self.roi.get_box()
91 l, r = max(0, int(box[0])), min(self.size[1], int(box[2]))
92 t, b = max(0, int(box[1])), min(self.size[0], int(box[3]))
93 return slice(t,b), slice(l,r)
94
95 def get_subimg(self, s1=None, s2=None):
96 if s1==None:

Callers 4

get_subimgMethod · 0.95
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 1

get_boxMethod · 0.45

Tested by

no test coverage detected