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;