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

Method get_msk

imagepy/core/wraper/imageplus.py:74–86  ·  view source on GitHub ↗
(self, mode='in')

Source from the content-addressed store, hash-verified

72 def img(self):return self.imgs[self.cur]
73
74 def get_msk(self, mode='in'):
75 if self.roi==None:return None
76 if self.msk is None:
77 self.msk = np.zeros(self.size, dtype=np.bool)
78 if self.roi.update or mode!=self.mskmode:
79 self.msk[:] = 0
80 if isinstance(mode, int):
81 self.roi.sketch(self.msk, w=mode, color=True)
82 else: self.roi.fill(self.msk, color=True)
83 if mode=='out':self.msk^=True
84 self.roi.update = False
85 self.mskmode=mode
86 return self.msk
87
88 def get_rect(self):
89 if self.roi==None:return slice(None), slice(None)

Callers 15

resetMethod · 0.95
runMethod · 0.80
process_oneFunction · 0.80
process_stackFunction · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
previewMethod · 0.80

Calls 2

sketchMethod · 0.45
fillMethod · 0.45

Tested by

no test coverage detected