def paint_circle(self, label_to_paint: int, center: QPointF): try: # this has to finish, we don't want to break UI interaction if self.instance_selected: center_pt = np.rint(center.toTuple()).astype(dtype=np.int) self.instance_selected.paint_circle(label_to_paint, center_pt) self.instance_selected.grab_cut_update() self.overlay_refresh_after_edit() else: log.info('paint_circle: no instance is selected') except Exception as e: log.exception('Exception in paint_circle')
def qml_point_to_np(qpoint: QPointF): return np.array(qpoint.toTuple())