title: Getting imageitem values from pyqtgraph
body: <p>I am working on my first PyQt program and feel like I am missing something obvious about ImageItems or GraphicsScenes.  I have a 2d ImageItem displayed with PyQtGraph using ImageView.  My data is a numpy array.  When the mouse is hovered over a spot on the image, I am able to get x and y position values, but would also like to know the image/z/array value.  I found a similar question that showed how to get the x and y values, but not the image value.  I included the code I am currently using with PyQt4 and python 2.7 in Windows and the link to the other post.</p>
  
  <p><a href="https://groups.google.com/forum/#!topic/pyqtgraph/srQqVW9bqPg" rel="nofollow">https://groups.google.com/forum/#!topic/pyqtgraph/srQqVW9bqPg</a></p>
  
  <pre><code>    import pyqtgraph as pg
  
      self.image = pg.ImageView(self)
      self.image.show()
      self.image.setImage(data)
  
      self.image.scene.sigMouseMoved.connect(self.mouseMoved)
  
      def mouseMoved(self, pos):
          x = self.image.getImageItem().mapFromScene(pos).x()
          y = self.image.getImageItem().mapFromScene(pos).y()
  </code></pre>
  
  <p>This gets values for x and y, but I don't know how to convert them to array indices or to just get the z value in some other way.  If there is a better method than mapFromScene, that would be nice to know also.</p>