code: def _function(self):
          
  
          self.data = {'nv_locations': [], 'image_data': None, 'extent': None}
  
          self.progress = 50
          self.updateProgress.emit(self.progress)
          # keep script alive while NVs are selected
          while not self._abort:
              time.sleep(1)
docs: Waits until stopped to keep script live. Gui must handle calling of Toggle_NV function on mouse click.