From 7cfaa66bbcfb27012ac4299120dfa6e8c765620a Mon Sep 17 00:00:00 2001 From: Marie Hartung Date: Mon, 8 Jul 2024 10:09:38 +0200 Subject: [PATCH] Fixed bug: Minimap updates if picture is updated using the file menu --- cellpose/gui/guiparts.py | 3 +++ cellpose/gui/io.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cellpose/gui/guiparts.py b/cellpose/gui/guiparts.py index a264cace..ea9a4c75 100644 --- a/cellpose/gui/guiparts.py +++ b/cellpose/gui/guiparts.py @@ -440,6 +440,9 @@ def __init__(self, parent=None): # Add the viewbox to the image widget self.image_widget.addItem(self.viewbox) + # This marks the menu button as checked + parent.minimapWindow.setChecked(True) + def closeEvent(self, event: QEvent): """ Method to uncheck the button in the menu if the window is closed. diff --git a/cellpose/gui/io.py b/cellpose/gui/io.py index 2b0b27da..c1b47ffc 100644 --- a/cellpose/gui/io.py +++ b/cellpose/gui/io.py @@ -149,11 +149,10 @@ def _load_image(parent, filename=None, load_seg=True, load_3D=False): parent.minimapWindow.setChecked(False) # Create a new instance before calling update_image parent.minimap_window_instance = guiparts.MinimapWindow(parent) + parent.minimap_window_instance.show() else: parent.minimap_window_instance = guiparts.MinimapWindow(parent) parent.minimap_window_instance.show() - # We want to mark the "minimap" menu button as checked if an image is loaded - parent.minimapWindow.setChecked(True) def _initialize_images(parent, image, load_3D=False):