slice_viewer.py 文件源码

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

项目:BrainModulyzer 作者: sugeerth 项目源码 文件源码
def updateSliceLabel(self):
        image_slice = self.extractSlice(self.template)
        image_data = (255 << 24 | image_slice << 16 | image_slice << 8 | image_slice)
        self.TemplateImageData = image_data
        parcelation_slice = self.extractParcelationSlice(self.parcelation)
        indices = np.flatnonzero(parcelation_slice)

        for idx in indices:
            image_data.flat[idx] = self.clut[parcelation_slice.flat[idx]-1]

        image_data = np.array(image_data[:, ::-1], order='F')
        image = QtGui.QImage(image_data, image_data.shape[0], image_data.shape[1], QtGui.QImage.Format_ARGB32)
        image = image.scaled(self.scaleFactor*image.width(), self.scaleFactor*image.height())
        self.label.setPixmap(QtGui.QPixmap.fromImage(image))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号