From 46027451b7e4e5469de1daab426c67de65db17b7 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Sun, 1 Dec 2024 16:58:42 +0100 Subject: [PATCH] add new possibility to delete points on demand --- src/main/java/ai/nets/samj/gui/MainGUI.java | 2 ++ src/main/java/ai/nets/samj/ui/ConsumerInterface.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/ai/nets/samj/gui/MainGUI.java b/src/main/java/ai/nets/samj/gui/MainGUI.java index 5d2e0ea..471f665 100644 --- a/src/main/java/ai/nets/samj/gui/MainGUI.java +++ b/src/main/java/ai/nets/samj/gui/MainGUI.java @@ -446,6 +446,8 @@ private < T extends RealType< T > & NativeType< T > > void batchSAMize() throws return; } this.consumer.addPolygonsFromGUI(this.cmbModels.getSelectedModel().processBatchOfPrompts(pointPrompts, rectPrompts, rai)); + pointPrompts.stream().forEach(pp -> consumer.deletePointRoi(pp)); + rectPrompts.stream().forEach(pp -> consumer.deleteRectRoi(pp)); } private void createListeners() { diff --git a/src/main/java/ai/nets/samj/ui/ConsumerInterface.java b/src/main/java/ai/nets/samj/ui/ConsumerInterface.java index 66936a2..c502fbb 100644 --- a/src/main/java/ai/nets/samj/ui/ConsumerInterface.java +++ b/src/main/java/ai/nets/samj/ui/ConsumerInterface.java @@ -87,6 +87,10 @@ public abstract class ConsumerInterface { public abstract void setFocusedImage(Object image); public abstract void deselectImage(); + + public abstract void deletePointRoi(int[] pp); + + public abstract void deleteRectRoi(Rectangle rect); public void setModel(SAMModel model) { this.selectedModel = model;