class_docstr: This is the matplotlib based GUI for a single analysis
  It assumes the analysis is simple image data (this could be abstracted)
class_docstr_tok: ["This","is","the","matplotlib","based","GUI","for","a","single","analysis","It","assumes","the","analysis","is","simple","image","data","(","this","could","be","abstracted",")"]
docstr: Set the forground image index
  
  Args:
      index (integer): Must be in the range of the number of hyperspectral images in the data.
docstr_tok: ["Set","the","forground","image","index","Args",":","index","(","integer",")",":","Must","be","in","the","range","of","the","number","of","hyperspectral","images","in","the","data","."]
code: def set_image_index(self, index):
      """Set the forground image index
  
      Args:
          index (integer): Must be in the range of the number of hyperspectral images in the data.
      """
      self.index = index
      image = Image.fromarray(
          self.data[..., index], "L"
      )  # 8-bit black white
      # print(f"Image size: {image.size}")
      alfa_im = Image.fromarray(self.alphas, "L")
      # print(f"Alfa size: {alfa_im.size}")
      comp_image = Image.composite(image, self.back_blend, alfa_im)
      comp_array = np.array(comp_image)
      # print(f"comp array shape: {comp_array.shape}")
      self.display_img.set_clim(
          vmin=comp_array.min(), vmax=comp_array.max()
      )
      self.display_img.set_array(
          np.reshape(comp_array, self.image_dimensions)
      )
      self.force_refresh()
  
imports: import os
  from pathlib import Path
  import numpy
  import matplotlib.pyplot
  import matplotlib.style
  from matplotlib.backends.backend_qt5agg import FigureCanvas
  from matplotlib.figure import Figure
  from PyQt5.QtWidgets import QVBoxLayout, QWidget, QLabel, QSpinBox, QFormLayout, QPushButton, QFileDialog, QSlider
  from PyQt5.QtCore import pyqtSlot, Qt
  from PIL import Image
label_desc: Use image node_id 5 for calling the HyperspectralImageCanvas obj's underlying member method code with example usage: obj.set_image_index(index) without return types