Skip to content

Commit

Permalink
1922 live view emit dir structure on load (#1923)
Browse files Browse the repository at this point in the history
  • Loading branch information
samtygier-stfc authored Sep 13, 2023
2 parents b8a7a2f + 9e75dd4 commit 2a4c477
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#1922 : Load images into live viewer on initialisation if images already present in selected directory.
2 changes: 1 addition & 1 deletion mantidimaging/gui/windows/live_viewer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def path(self, path: Path) -> None:
self._dataset_path = path
self.image_watcher = ImageWatcher(path)
self.image_watcher.image_changed.connect(self._handle_image_changed_in_list)
self.image_watcher.find_images()
self.image_watcher._handle_directory_change("")

def _handle_image_changed_in_list(self, image_files: list[Image_Data]) -> None:
"""
Expand Down
3 changes: 1 addition & 2 deletions mantidimaging/gui/windows/live_viewer/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@ def __init__(self, main_window: 'MainWindowView', live_dir_path: Path) -> None:
self.presenter = LiveViewerWindowPresenter(self, main_window)
self.live_viewer = LiveViewWidget()
self.imageLayout.addWidget(self.live_viewer)
self.live_viewer.z_slider.valueChanged.connect(self.presenter.select_image)

def show(self) -> None:
"""Show the window"""
super().show()
self.activateWindow()
self.watch_directory()

self.live_viewer.z_slider.valueChanged.connect(self.presenter.select_image)

def show_most_recent_image(self, image: np.ndarray) -> None:
"""
Show the most recently modified image in the image view.
Expand Down

0 comments on commit 2a4c477

Please sign in to comment.