Hi there,
I'd like to analyze two linked images (they are amplitude and phase of an electric field) in a stack of images. Therefore I'd like to synchronize the x, y and t axes of an imageview. To set up something like that, Islightly adapted the example code:
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import numpy as np
## Create window with two ImageView widgets
win = QtGui.QMainWindow()
win.resize(800,800)
win.setWindowTitle('pyqtgraph example: DataSlicing')
cw = QtGui.QWidget()
win.setCentralWidget(cw)
l = QtGui.QGridLayout()
cw.setLayout(l)
imv1 = pg.ImageView(view=pg.PlotItem())
imv2 = pg.ImageView(view=pg.PlotItem())
l.addWidget(imv1, 0, 0)
l.addWidget(imv2, 1, 0)
# link the two views
imv1.view.setXLink(imv2.view)
imv1.view.setYLink(imv2.view)
win.show()
def display_amp_phase(E):
amp = abs(E)
phase = np.angle(E)
imv1.setImage(amp)
imv2.setImage(phase)
display_amp_phase(exp(1j*np.random.rand(5,1000,1000)))
However, there is no such function as setTLink to make sure that when scrolling through the stack of images both of them scroll to the same image. How do I do that? I found out that there is a
imv2.timeLine.value()
and
imv2.timeLine.setValue,
so somehow they need to be linked together, but how do I set that up?
regards,
Dirk Boonzajer