subpanel.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:bonsu 作者: bonsudev 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号