class_docstr: The control widget for setting the visible
  layer, and the background image.
class_docstr_tok: ["The","control","widget","for","setting","the","visible","layer",",","and","the","background","image","."]
code: def __init__(self):
      super(HyperspectralImageViewer, self).__init__()
      self.main_layout = QVBoxLayout(self)
      self.image_widget = HyperspectralImageCanvas()
      self.main_layout.addWidget(self.image_widget)
      self.bkgrnd_name = None
      # self.control_layout = QHBoxLayout(self)
      self.control_layout = QFormLayout(self)
      # self.control_layout.addWidget(QLabel("Select image dimension: "))
      self.image_spin = QSpinBox(self)
      self.image_spin.setValue(0)
      self.image_spin.setRange(0, 0)
      self.image_spin.valueChanged[int].connect(self.on_image_changed)
      # self.control_layout.addWidget(self.image_spin)
      self.control_layout.addRow(
          QLabel("Select image dimension: "), self.image_spin
      )
      self.bkgrnd_button = QPushButton("Data")
      self.bkgrnd_button.clicked.connect(self.on_load_bkgrnd)
      self.bkgrnd_label = QLabel("<optionally choose background .png>")
      self.control_layout.addRow(self.bkgrnd_button, self.bkgrnd_label)
      self.blend_slider = QSlider(Qt.Horizontal, self)
      self.blend_slider.setValue(50)
      self.blend_slider.valueChanged.connect(self.change_blend)
      self.control_layout.addRow(QLabel("Blend: "), self.blend_slider)
  
      self.main_layout.addLayout(self.control_layout)
      self.main_layout.setStretch(0, 1)
      self.setLayout(self.main_layout)
      self.data = None
  
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 1 to create a new HyperspectralImageViewer object from inherited base classes: QWidget with example: obj = HyperspectralImageViewer()