Skip to content

Commit

Permalink
Merge pull request #1023 from annie-xd-wang/Catch-Displaying-TclError
Browse files Browse the repository at this point in the history
  • Loading branch information
AdvancedImagingUTSW authored Oct 24, 2024
2 parents 6aa7625 + 05c5283 commit 895e9bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/navigate/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,7 @@ def display_images(
if microscope_name not in self.additional_microscopes:
self.additional_microscopes[microscope_name] = {}

if "camera_view_controller" not in self.additional_microscopes[microscope_name]:
popup_window = CameraViewPopupWindow(self.view, microscope_name)
camera_view_controller = CameraViewController(
popup_window.camera_view, self
Expand Down
15 changes: 9 additions & 6 deletions src/navigate/controller/sub_controllers/camera_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,12 +906,15 @@ def populate_image(self, image):
Image data.
"""
temp_img = self.array_to_image(image)
if self.image_cache_flag:
self.tk_image = ImageTk.PhotoImage(temp_img)
self.canvas.create_image(0, 0, image=self.tk_image, anchor="nw")
else:
self.tk_image2 = ImageTk.PhotoImage(temp_img)
self.canvas.create_image(0, 0, image=self.tk_image2, anchor="nw")
try:
if self.image_cache_flag:
self.tk_image = ImageTk.PhotoImage(temp_img)
self.canvas.create_image(0, 0, image=self.tk_image, anchor="nw")
else:
self.tk_image2 = ImageTk.PhotoImage(temp_img)
self.canvas.create_image(0, 0, image=self.tk_image2, anchor="nw")
except tk.TclError:
return
self.image_cache_flag = not self.image_cache_flag

def process_image(self):
Expand Down

0 comments on commit 895e9bb

Please sign in to comment.