class_docstr: Display an embedding gui for interaction and selection.
  In addition show the number of landmarks selected and give the
  user the chance to start a new analysis
class_docstr_tok: ["Display","an","embedding","gui","for","interaction","and","selection",".","In","addition","show","the","number","of","landmarks","selected","and","give","the","user","the","chance","to","start","a","new","analysis"]
docstr: Handle a user selection operation in the plot
  Save the indexes and feed them back to the controller
  
  Args:
      indexes (np.ndarray): selection indexes
      selection_event (SelectionEvent.Enum): A permanent or transient (mouse over) selection
docstr_tok: ["Handle","a","user","selection","operation","in","the","plot","Save","the","indexes","and","feed","them","back","to","the","controller","Args",":","indexes","(","np.ndarray",")",":","selection","indexes","selection_event","(","SelectionEvent.Enum",")",":","A","permanent","or","transient","(","mouse","over",")","selection"]
code: def on_selection(self, indexes, selection_event):
      """Handle a user selection operation in the plot
      Save the indexes and feed them back to the controller
  
      Args:
          indexes (np.ndarray): selection indexes
          selection_event (SelectionEvent.Enum): A permanent or transient (mouse over) selection
      """
      # print(f"indexes: {indexes.shape} selection size: {len(list(indexes))} perm: {permanent}")
      if selection_event is SelectionEvent.PERMANENT:
          self.selection_list = indexes
          self.landmarks_label.setText(
              f"Landmarks selected: {len(self.selection_list)}"
          )
          self.on_selection_callback(self.selection_list, False)
      else:
          # mouse over - dont change the selection list
          if len(indexes) == 0:
              # restore the previous selection
              if len(self.selection_list) > 0:
                  self.on_selection_callback(self.selection_list, False)
          else:
              self.on_selection_callback(indexes, False)
  
imports: import io
  from enum import Enum
  import numpy
  import matplotlib.pyplot
  import matplotlib.style
  from matplotlib.widgets import RectangleSelector, LassoSelector, EllipseSelector, PolygonSelector
  from matplotlib.path import Path
  from matplotlib.backends.backend_qt5agg import FigureCanvas
  from matplotlib.figure import Figure
  from PyQt5 import QtWidgets, QtCore
  from cursors import DrawingCursors, DrawingShape, DrawingMode
label_desc: Use image node_id 5 for calling the EmbeddingViewer obj's underlying member method code with example usage: obj.on_selection(indexes, selection_event) without return types