Skip to content

Commit

Permalink
fix: intermediate plotting of first event whenever a slot is added
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jan 1, 2024
1 parent 7c1ace5 commit f4b9a5e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
2.14.3
- fix: intermediate plotting of first event whenever a slot is added
- fix: catch zero-division warning when plotting empty image
- enh: avoid showing first dataset event when user clicks in QuickView
- setup: bump dclab from 0.55.7 to 0.56.3 (enhanced basin support)
2.14.2
Expand Down
2 changes: 2 additions & 0 deletions shapeout2/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ def on_quickview(self, view=True):
@QtCore.pyqtSlot()
def on_quickview_refresh(self):
"""Refresh quickview with the currently shown dataset"""
print("REFRESH", self.sender())
slot_index, filt_index = self.block_matrix.get_quickview_indices()
if slot_index is not None:
self.on_quickview_show_dataset(slot_index, filt_index,
Expand All @@ -964,6 +965,7 @@ def on_quickview_show_dataset(self, slot_index, filt_index,
the one where QuickView is currently set active. If
False, nothing is changed.
"""
print("SHOW", self.sender())
ds = self.pipeline.get_dataset(slot_index=slot_index,
filt_index=filt_index,
apply_filter=True)
Expand Down
4 changes: 2 additions & 2 deletions shapeout2/gui/quick_view/qv_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def get_event_image(self, ds, event):
# automatic contrast
if state["event"]["image auto contrast"]:
vmin, vmax = cellimg.min(), cellimg.max()
cellimg = (cellimg - vmin) / (vmax - vmin) * 255
cellimg = (cellimg - vmin) / max(vmax - vmin, 1) * 255
# convert to RGB
cellimg = cellimg.reshape(
cellimg.shape[0], cellimg.shape[1], 1)
Expand Down Expand Up @@ -692,6 +692,7 @@ def show_event(self, event):
self.tableWidget_feats.set_key_vals(keys, vals)

@show_wait_cursor
@QtCore.pyqtSlot(object, object)
def show_rtdc(self, rtdc_ds, slot):
"""Display an RT-DC measurement given by `path` and `filters`"""
# Create a hierarchy child so that the user can browse
Expand Down Expand Up @@ -742,7 +743,6 @@ def show_rtdc(self, rtdc_ds, slot):
self.spinBox_event.blockSignals(True)
self.spinBox_event.setMaximum(event_count)
self.spinBox_event.setToolTip("total: {}".format(event_count))
self.spinBox_event.setValue(1)
self.spinBox_event.blockSignals(False)

# set quick view state
Expand Down

0 comments on commit f4b9a5e

Please sign in to comment.