title: Pyqtgraph ImageView not updating after QSlider value changed
body: <p>I'm working on a PyQt5 + pyqtgraph user interface. The main idea is to have an image viewer that I can update using widgets from the Main Window, like sliders, line edits, buttons... By now I'm having trouble updating the image when I move the slicer. It connects to the expected functions, but the image on the ImageViewer keeps always the same (the first one). How can I solve this? I know that pyqtgraph ImageViewer can deal with 3D arrays, but in the future, I will have to add more than one viewer that will be updated by the same slider. This is the code I have:</p>
  
  <p>This HDF5 file that I'm using is a (2048, 2048, 10) size array (10 uint16 images inside).</p>
  
  <pre><code>from PyQt5 import QtGui, QtWidgets, uic
  import pyqtgraph as pg
  import numpy as np
  import os, sys, h5py
  
  class ZoomGUI:
      def __init__(self, parent=None):
          self.ui = uic.loadUi(os.path.dirname(os.path.realpath(__file__)) + '/GUI/ZoomGUI.ui')
  
          self.file_path = "recon/tomo-2048x2048x10_16bit.h5"
  
          #Configure slices slicer
          self.number_of_slices = self.get_number_of_slices()
          self.ui.slicesSlider.setMaximum(self.number_of_slices-1)
          self.ui.slicesSlider.valueChanged.connect(self.imageView)
          self.updateImage()
  
          #Add image widget
          self.ui.ImageWidget.setLayout(QtGui.QVBoxLayout())
          self.ui.ImageWidget.layout().addWidget(self.imv)
  
  
      def imageView(self,slice_number):
          self.imv = pg.ImageView()
          self.imagedata = self.get_image(slice_number)
          print(self.imagedata)
          self.imv.setImage(self.imagedata)
  
      def updateImage(self):
          actual_slice = int(self.ui.slicesSlider.value())
          self.imageView(actual_slice)
  
      #File related functions
      def get_image(self, slice_number):
          h5 = h5py.File(self.file_path, "r")
          data = h5["slices"][slice_number]
          h5.close()
          return(data)
  
      def get_number_of_slices(self):
          h5 = h5py.File(self.file_path, "r")
          size = len(h5["slices"])
          h5.close()
          return(size)
  
  if __name__ == '__main__':
      app = QtGui.QApplication(sys.argv)      
      ZoomGUI = ZoomGUI()               
      ZoomGUI.ui.show()                  
      app.exec_()
  </code></pre>
  
  <p>This is the .ui file. It only has the slider and a QWidget widget.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ui version="4.0"&gt;
   &lt;class&gt;MainWindow&lt;/class&gt;
   &lt;widget class="QMainWindow" name="MainWindow"&gt;
    &lt;property name="geometry"&gt;
     &lt;rect&gt;
      &lt;x&gt;0&lt;/x&gt;
      &lt;y&gt;0&lt;/y&gt;
      &lt;width&gt;1132&lt;/width&gt;
      &lt;height&gt;880&lt;/height&gt;
     &lt;/rect&gt;
    &lt;/property&gt;
    &lt;property name="windowTitle"&gt;
     &lt;string&gt;MainWindow&lt;/string&gt;
    &lt;/property&gt;
    &lt;widget class="QWidget" name="centralwidget"&gt;
     &lt;layout class="QGridLayout" name="gridLayout_2"&gt;
      &lt;item row="0" column="0"&gt;
       &lt;layout class="QGridLayout" name="gridLayout"&gt;
        &lt;item row="0" column="0"&gt;
         &lt;layout class="QGridLayout" name="ImageWidgetLayout"&gt;
          &lt;item row="0" column="0"&gt;
           &lt;widget class="QWidget" name="ImageWidget" native="true"/&gt;
          &lt;/item&gt;
         &lt;/layout&gt;
        &lt;/item&gt;
        &lt;item row="2" column="0"&gt;
         &lt;widget class="QPushButton" name="pushButton"&gt;
          &lt;property name="text"&gt;
           &lt;string&gt;PushButton&lt;/string&gt;
          &lt;/property&gt;
         &lt;/widget&gt;
        &lt;/item&gt;
        &lt;item row="1" column="0"&gt;
         &lt;widget class="QSlider" name="slicesSlider"&gt;
          &lt;property name="orientation"&gt;
           &lt;enum&gt;Qt::Horizontal&lt;/enum&gt;
          &lt;/property&gt;
         &lt;/widget&gt;
        &lt;/item&gt;
       &lt;/layout&gt;
      &lt;/item&gt;
     &lt;/layout&gt;
    &lt;/widget&gt;
    &lt;widget class="QMenuBar" name="menubar"&gt;
     &lt;property name="geometry"&gt;
      &lt;rect&gt;
       &lt;x&gt;0&lt;/x&gt;
       &lt;y&gt;0&lt;/y&gt;
       &lt;width&gt;1132&lt;/width&gt;
       &lt;height&gt;26&lt;/height&gt;
      &lt;/rect&gt;
     &lt;/property&gt;
    &lt;/widget&gt;
    &lt;widget class="QStatusBar" name="statusbar"/&gt;
   &lt;/widget&gt;
   &lt;resources/&gt;
   &lt;connections/&gt;
  &lt;/ui&gt;
  </code></pre>