class_docstr: The containing dialog and controller for the embedding
  and the image viewer that together make up an analysis
  (i.e. a user selection at an hSNE scale). It also
  iterates over the embedding once the analysis is created
  and this is dynamically displayed in the embedding gui.
docstr: Cleanup while closing
docstr_tok: ["Cleanup","while","closing"]
code: def cleanup(self, remove_analysis=True):
      """Cleanup while closing"""
      if self.analysis is None:
          return
      if remove_analysis:
          print("Deleting analysis on close")
          self.remove_analysis(self.analysis.id)
      del self.analysis
      self.analysis = None
  
imports: import time
  import numpy
  from PyQt5 import QtWidgets
  from EmbeddingGui import EmbeddingViewer
  from ModelGui import DemoType
  from CompositeImageViewer import CompositeImageViewer
  from HyperspectralImageViewer import HyperspectralImageViewer
  from MetaDataViewer import MetaDataViewer
label_desc: Use image node_id 14 for calling the AnalysisController obj's underlying member method code with example usage: obj.cleanup(remove_analysis) without return types