def UpdateImage2D(self):
object = self.object
imagedata = numpy.array(object, dtype=numpy.double)
imagedata[imagedata < 1e-6] = 1.0
imagedata = numpy.log(imagedata)
imagedata = imagedata - imagedata.min()
if imagedata.max() > 0:
imagedata = (255.0/imagedata.max())*imagedata
else:
imagedata = 255.0*imagedata
imagedatalow = numpy.uint8(imagedata)
self.impil = Image.fromarray(imagedatalow, 'L').resize((self.sx,self.sy))
self.imwx = wx.EmptyImage( self.impil.size[0], self.impil.size[1] )
self.imwx.SetData( self.impil.convert( 'RGB' ).tobytes() )
bitmap = wx.BitmapFromImage(self.imwx)
self.bmp = bitmap
self.image.SetBitmap(bitmap)
self.Refresh()
self.Layout()
评论列表
文章目录