code: def updateData():
      global img, data, i, updateTime, elapsed
  
      ## Display the data
      img.setImage(data[i])
      i = (i + 1) % data.shape[0]
  
      timer.start(1)
      now = perf_counter()
      elapsed_now = now - updateTime
      updateTime = now
      elapsed = elapsed * 0.9 + elapsed_now * 0.1
  
imports: from time import perf_counter
  import numpy
  import pyqtgraph
  from pyqtgraph.Qt import QtCore
label_desc: Use image node_id 1 for calling a global function with example usage: updateData() without return types