Thank you Patrick for your suggestion. It looks promising, I'll investigate it further Steve
> On 18 February 2020 at 02:47 Patrick <[email protected]> wrote: > > Hi, > > Have you seen the crosshair/mouse interaction example? > http://www.pyqtgraph.org/downloads/0.10.0/pyqtgraph-0.10.0-deb/pyqtgraph-0.10.0/examples/crosshair.py > > You may need to convert the axis coordinates (probably just > rounding/casting to integer), and maybe do some bounds checking, but then > just take the mouse move event coordinates and use them to index the value > from your pixelArray. > > Patrick > > On Tuesday, 18 February 2020 01:49:11 UTC+10:30, Stephen Shillitoe wrote: > > > > > > > > I have built a PyQt5, Python 3.7 windows application that uses > > PyQtGraph to view monochrome (greyscale) Magnetic Resonance DICOM images. > > As I move the mouse pointer over the image, I would like to display the > > value of the pixel under the pointer on the window. There is no obvious (to > > me) functionality in PyQtGraph to do this. I would be very grateful for any > > suggestions by more experienced developers of how to do this. Here is an > > edited code segment showing how I display the image (pixelArray) in an MDI > > subwindow. > > > > > > layout = QVBoxLayout() > > widget = QWidget() > > widget.setLayout(layout) > > self.subWindow.setWidget(widget) > > > > imageViewer = pg.GraphicsLayoutWidget() > > viewBox = imageViewer.addViewBox() > > image= pg.ImageItem(border='w') > > viewBox.addItem(image) > > imageView = pg.ImageView(view=viewBox, imageItem=image) > > layout.addWidget(imageView) > > imageView.setImage(pixelArray) > > > > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "pyqtgraph" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > mailto:[email protected] . > To view this discussion on the web visit > https://groups.google.com/d/msgid/pyqtgraph/cb625e45-ceb8-4227-a4bd-d5e8d3e38527%40googlegroups.com > > https://groups.google.com/d/msgid/pyqtgraph/cb625e45-ceb8-4227-a4bd-d5e8d3e38527%40googlegroups.com?utm_medium=email&utm_source=footer > . > -- You received this message because you are subscribed to the Google Groups "pyqtgraph" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/1041940958.2655258.1582021960123%40mail2.virginmedia.com.
