def run(self, para=None): ips = self.app.get_img() if ips == None: img = np.arange(256 * 30, dtype=np.uint8).reshape((-1, 256)) ips = Image([img], self.title) ips.lut = self.lut return self.app.show_img(ips) if ips.channels != 1: return self.app.alert( 'only one channel image surport Lookup table!') ips.lut = self.lut ips.update()
def run(self, ips, imgs, para=None): shp = ips.img.shape[:2] imgs = [ np.zeros(shp, dtype=np.uint8) for i in range([1, len(imgs)][para['slice']]) ] newips = Image(imgs, ips.title + '-mark') newips.back = ips idx = [ 'None', 'Max', 'Min', 'Mask', '2-8mix', '4-6mix', '5-5mix', '6-4mix', '8-2mix' ] modes = ['set', 'max', 'min', 'msk', 0.2, 0.4, 0.5, 0.6, 0.8] newips.lut = ColorManager.get(para['cm']) newips.mode = modes[idx.index(para['mode'])] #newips.range = (0, para['n']) self.app.show_img(newips)