Skip to content

Commit 387c8c1

Browse files
committed
Fix: refresh plot for unselected images when viewing in a new window
Fix #159
1 parent 2ff6751 commit 387c8c1

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ See DataLab [roadmap page](https://datalab-platform.com/en/contributing/roadmap.
1414
* Fixed [Issue #152](https://github.com/DataLab-Platform/DataLab/issues/152) - Ignore `nan` values for image normalization, flatfield correction, offset correction, and centroid computation
1515
* Fixed [Issue #153](https://github.com/DataLab-Platform/DataLab/issues/153) - Ignore `nan` values for signal normalization and statistics computations (both analysis result and interactive tool)
1616
* Fixed [Issue #158](https://github.com/DataLab-Platform/DataLab/issues/158) - When editing ROI of a list of images, the first image of the selection is shown (instead of the last as in the image panel)
17+
* Fixed [Issue #159](https://github.com/DataLab-Platform/DataLab/issues/159) - When selecting multiple images just after opening an HDF5 file, the "View in a new window" feature does not work (`KeyError` exception)
1718

1819
## DataLab Version 0.19.0 ##
1920

cdl/core/gui/panel/base.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,16 @@ def open_separate_view(
10981098
oids = self.objview.get_sel_object_uuids(include_groups=True)
10991099
obj = self.objmodel[oids[0]]
11001100

1101+
if not all([oid in self.plothandler for oid in oids]):
1102+
# This happens for example when opening an already saved workspace with
1103+
# multiple images, and if the user tries to view in a new window a group of
1104+
# images without having selected any object yet. In this case, only the
1105+
# last image is actually plotted (because if the other have the same size
1106+
# and position, they are hidden), and the plot item of every other image is
1107+
# not created yet. So we need to refresh the plot to create the plot item of
1108+
# those images.
1109+
self.plothandler.refresh_plot("selected", True, True)
1110+
11011111
# Create a new dialog and add plot items to it
11021112
dlg = self.create_new_dialog(
11031113
title=obj.title if len(oids) == 1 else None,

0 commit comments

Comments
 (0)