Python pyqtgraph.ImageView() Examples
The following are 7
code examples of pyqtgraph.ImageView().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
pyqtgraph
, or try the search function
.
Example #1
Source File: diffshow.py From scikit-ued with MIT License | 6 votes |
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)
Example #2
Source File: metadata_reader.py From stytra with GNU General Public License v3.0 | 5 votes |
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()
Example #3
Source File: PlotWindow.py From qkit with GNU General Public License v2.0 | 5 votes |
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()
Example #4
Source File: test_ref_cycles.py From soapy with GNU General Public License v3.0 | 5 votes |
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())
Example #5
Source File: test_ref_cycles.py From qgisSpaceSyntaxToolkit with GNU General Public License v3.0 | 5 votes |
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())
Example #6
Source File: test_ref_cycles.py From tf-pose with Apache License 2.0 | 4 votes |
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())
Example #7
Source File: mainwindow.py From hypers with BSD 3-Clause "New" or "Revised" License | 4 votes |
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)