code: def calculate_ellipse_path(x1, y1, x2, y2):
      """This is how matplotlib draws the ellipse - thanks for the code"""
  
      xmin, xmax = sorted([x1, x2])
      ymin, ymax = sorted([y1, y2])
      center = [x1 + (x2 - x1) / 2.0, y1 + (y2 - y1) / 2.0]
      a = (xmax - xmin) / 2.0
      b = (ymax - ymin) / 2.0
      rad = np.deg2rad(np.arange(31) * 12)
      x = a * np.cos(rad) + center[0]
      y = b * np.sin(rad) + center[1]
      verts = np.stack((np.transpose(x), np.transpose(y)), 1)
      print(f"Shape verts {verts.shape}")
      return Path(verts)
  
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 1 for calling a global function with example usage: calculate_ellipse_path(x1, y1, x2, y2) and returns: Path