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: Initialize the image canvas with the hyperspectral data
  
  Args:
      data (np.ndarray): The hyperspectral data
      image_dimensions (array): Dimensions of the images given by each row of the data
      index (integer): Default image (row) index in the data
docstr_tok: ["Initialize","the","image","canvas","with","the","hyperspectral","data","Args",":","data","(","np.ndarray",")",":","The","hyperspectral","data","image_dimensions","(","array",")",":","Dimensions","of","the","images","given","by","each","row","of","the","data","index","(","integer",")",":","Default","image","(","row",")","index","in","the","data"]
code: def init_plot(self, data, image_dimensions, index=0):
      """Initialize the image canvas with the hyperspectral data
  
      Args:
          data (np.ndarray): The hyperspectral data
          image_dimensions (array): Dimensions of the images given by each row of the data
          index (integer): Default image (row) index in the data
      """
      self.image_dimensions = image_dimensions
      # alpha will cause fade to black background
      self.black_back = Image.fromarray(
          np.full(image_dimensions, 0, dtype=np.uint8), "L"
      )
      self.background = self.black_back
      self.back_blend = Image.blend(
          self.black_back, self.background, self.blend
      )
      self.data = np.reshape(data, (*image_dimensions, data.shape[1]))
      print(f"Reshaped: {self.data.shape}")
      self.alphas = np.full(image_dimensions, 255, dtype=np.uint8)
      self.index = index
  
      # start with a image 0
      self.display_img = self.ix.imshow(
          self.data[..., self.index],
          interpolation="bilinear",
          cmap="gray",
          vmin=0,
          vmax=255,
      )
  
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 2 for calling the HyperspectralImageCanvas obj's underlying member method code with example usage: obj.init_plot(data, image_dimensions, index) without return types