From 0bd7a5ccc528be2ac362efee929e27e0c6f31ae3 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Wed, 4 Dec 2024 10:58:21 +0100 Subject: [PATCH] do not reset the roi manager and aset image in focus --- src/main/java/ai/nets/samj/ij/ui/Consumer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/ai/nets/samj/ij/ui/Consumer.java b/src/main/java/ai/nets/samj/ij/ui/Consumer.java index 9afa6c3..ce6dd17 100644 --- a/src/main/java/ai/nets/samj/ij/ui/Consumer.java +++ b/src/main/java/ai/nets/samj/ij/ui/Consumer.java @@ -212,6 +212,11 @@ public boolean isValidPromptSelected() { @Override public void setFocusedImage(Object image) { + boolean changed = activeImage != (ImagePlus) image; + if (!changed) { + WindowManager.setCurrentWindow(activeWindow); + return; + } activeImage = (ImagePlus) image; this.activeCanvas = this.activeImage.getCanvas(); this.activeWindow = this.activeImage.getWindow(); @@ -594,7 +599,7 @@ private RoiManager startRoiManager() { if (roiManager == null) { roiManager = new RoiManager(); } - roiManager.reset(); + // TODO what to do? roiManager.reset(); roiManager.setVisible(true); roiManager.setTitle("SAM Roi Manager"); Prefs.useNamesAsLabels = true;