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

Method load

imagepy/menus/Image/Adjust/threshold_plg.py:33–48  ·  view source on GitHub ↗
(self, ips)

Source from the content-addressed store, hash-verified

31 arange = (0,255)
32
33 def load(self, ips):
34 hist = np.histogram(self.ips.lookup(),list(range(257)))[0]
35 if ips.imgtype == '8-bit':
36 self.para = {'thr1':0, 'thr2':255}
37 self.view = [('hist', 'hist', hist),
38 ('slide', 'thr1', (0,255), 0, 'Low'),
39 ('slide', 'thr2', (0,255), 0, 'High')]
40 else :
41 self.para = {'thr1':ips.range[0], 'thr2':ips.range[1]}
42 self.view = [('hist', 'hist', hist,),
43 ('slide', 'thr1', ips.range, 10, 'Low'),
44 ('slide', 'thr2', ips.range, 10, 'High')]
45 self.arange = ips.range
46 self.lut = ips.lut
47 ips.lut = self.lut.copy()
48 return True
49
50 def show(self, temp=ThresholdDialog):
51 dialog = lambda win, title, lim = self.ips.range:temp(win, title, lim)

Callers

nothing calls this directly

Calls 2

histogramMethod · 0.80
lookupMethod · 0.45

Tested by

no test coverage detected