本文整理汇总了Python中pyqtgraph.ImageView方法的典型用法代码示例。如果您正苦于以下问题:Python pyqtgraph.ImageView方法的具体用法?Python pyqtgraph.ImageView怎么用?Python pyqtgraph.ImageView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph
的用法示例。
在下文中一共展示了pyqtgraph.ImageView方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import ImageView [as 别名]
def __init__(self, image, **kwargs):
super().__init__(**kwargs)
self.viewer = pg.ImageView()
with warnings.catch_warnings():
# Pesky FutureWarning from PyQtGraph
warnings.simplefilter("ignore")
self.viewer.setImage(image)
self.cursor_info = pg.QtGui.QLabel("")
self.cursor_info.setAlignment(pg.QtCore.Qt.AlignCenter)
self.__cursor_proxy = pg.SignalProxy(
self.viewer.scene.sigMouseMoved,
rateLimit=60,
slot=self.update_cursor_info,
)
self.setWindowTitle("scikit-ued image viewer")
layout = pg.QtGui.QVBoxLayout()
layout.addWidget(self.viewer)
layout.addWidget(self.cursor_info)
self.setLayout(layout)
示例2: image_viewer
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import ImageView [as 别名]
def image_viewer(self):
"""Open metadata image in the Image Viewer from PyQtGraph.
"""
self.win = QtGui.QMainWindow()
self.win.resize(800, 800)
self.fignp = np.array(Image.open(io.BytesIO(self.figbytes)))
self.fignp = np.swapaxes(self.fignp, 0, 1)
self.imv = pg.ImageView()
self.imv.setImage(self.fignp)
self.win.setCentralWidget(self.imv)
self.win.setWindowTitle("Metadata Image")
self.win.show()
示例3: __init__
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import ImageView [as 别名]
def __init__(self, parent=None, name='ImageView', view=None, imageItem=None, *args):
super(ImageViewMplColorMaps, self).__init__(parent=parent, name=name, view=view, imageItem=imageItem, *args)
self.gradientEditorItem = self.ui.histogram.item.gradient
self.activeCm = "viridis"
self.mplColorMaps = OrderedDict([
('inferno', {'ticks': [(0.0, (0, 0, 3, 255)), (0.25, (87, 15, 109, 255)), (0.5, (187, 55, 84, 255)), (0.75, (249, 142, 8, 255)), (1.0, (252, 254, 164, 255))], 'mode': 'rgb'}),
('plasma', {'ticks': [(0.0, (12, 7, 134, 255)), (0.25, (126, 3, 167, 255)), (0.5, (203, 71, 119, 255)), (0.75, (248, 149, 64, 255)), (1.0, (239, 248, 33, 255))], 'mode': 'rgb'}),
('magma', {'ticks': [(0.0, (0, 0, 3, 255)), (0.25, (80, 18, 123, 255)), (0.5, (182, 54, 121, 255)), (0.75, (251, 136, 97, 255)), (1.0, (251, 252, 191, 255))], 'mode': 'rgb'}),
('viridis', {'ticks': [(0.0, (68, 1, 84, 255)), (0.25, (58, 82, 139, 255)), (0.5, (32, 144, 140, 255)), (0.75, (94, 201, 97, 255)), (1.0, (253, 231, 36, 255))], 'mode': 'rgb'}),
])
self.registerCmap()
示例4: test_ImageView
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import ImageView [as 别名]
def test_ImageView():
def mkobjs():
iv = pg.ImageView()
data = np.zeros((10,10,5))
iv.setImage(data)
return mkrefs(iv, iv.imageItem, iv.view, iv.ui.histogram, data)
for i in range(5):
assert_alldead(mkobjs())
示例5: setupUi
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import ImageView [as 别名]
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1243, 458)
MainWindow.setStyleSheet("%background: #161616")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.imagewin = ImageView(self.centralwidget)
self.imagewin.setObjectName("imagewin")
self.horizontalLayout_2.addWidget(self.imagewin)
self.specwin = PlotWidget(self.centralwidget)
self.specwin.setObjectName("specwin")
self.horizontalLayout_2.addWidget(self.specwin)
self.horizontalLayout_2.setStretch(0, 40)
self.horizontalLayout_2.setStretch(1, 60)
self.gridLayout.addLayout(self.horizontalLayout_2, 1, 0, 1, 1)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.slider = QtWidgets.QSlider(self.centralwidget)
self.slider.setMaximum(10)
self.slider.setPageStep(1)
self.slider.setOrientation(QtCore.Qt.Horizontal)
self.slider.setObjectName("slider")
self.horizontalLayout_3.addWidget(self.slider)
self.updateSpectrum = QtWidgets.QPushButton(self.centralwidget)
self.updateSpectrum.setObjectName("updateSpectrum")
self.horizontalLayout_3.addWidget(self.updateSpectrum)
self.updateImage = QtWidgets.QPushButton(self.centralwidget)
self.updateImage.setObjectName("updateImage")
self.horizontalLayout_3.addWidget(self.updateImage)
self.Reset = QtWidgets.QPushButton(self.centralwidget)
self.Reset.setObjectName("Reset")
self.horizontalLayout_3.addWidget(self.Reset)
self.gridLayout.addLayout(self.horizontalLayout_3, 2, 0, 1, 1)
self.gridLayout.setRowStretch(1, 95)
self.gridLayout.setRowStretch(2, 5)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)