Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
enh: allow to hide raw trace data; fix: draw median trace on top of r…
Browse files Browse the repository at this point in the history
…aw trace
  • Loading branch information
paulmueller committed Jul 15, 2019
1 parent f6ae507 commit 07d741d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
- fix: Allow to open measurement files that do not contain the features
"area_um" or "deform" (#245)
- fix: Hide unused fluorescence trace line plots
- fix: Draw median trace data on top of raw trace data
- enh: Display session name in window title
- enh: Allow to hide raw fluorescence trace data
0.9.4
- fix: Wrong image/trace data shown for a selected event in the scatter
plot when working on a log-scale (#244)
Expand Down
28 changes: 27 additions & 1 deletion shapeout/gui/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ def __init__(self, parent, frame):
padding=0,
spacing=0)

for trid in dclab.definitions.FLUOR_TRACES:
# draw raw traces first
trace_keys = sorted(dclab.definitions.FLUOR_TRACES,
key=lambda x: x.count("median"))
for trid in trace_keys:
if trid.count("raw"):
color = "gray"
elif trid == "fl1_median":
Expand Down Expand Up @@ -136,6 +139,11 @@ def __init__(self, parent, frame):
self.plot_window.control.SetMinSize((300, 300))
sizer.Add(self.plot_window.control, (3,0), span=(2,2), flag=wx.EXPAND)

self.WXChB_showraw = wx.CheckBox(self, label="Show raw trace data")
self.WXChB_showraw.SetValue(True)
self.Bind(wx.EVT_CHECKBOX, self.OnChBoxShowRaw, self.WXChB_showraw)
sizer.Add(self.WXChB_showraw, (5,0))

self.SetSizer(sizer)
sizer.Fit(self)
self.sizer = sizer
Expand Down Expand Up @@ -205,6 +213,22 @@ def OnChBoxExclude(self, e=None):
mm.filter.manual[evt_id] = not self.WXChB_exclude.GetValue()


def OnChBoxShowRaw(self, e=None):
show = self.WXChB_showraw.GetValue()
names = [n for n in dclab.definitions.FLUOR_TRACES if n.count("raw")]
if show:
self.trace_plot.showplot(*names)
else:
self.trace_plot.hideplot(*names)
# hide unset traces
stillhidden = []
for n in names:
if np.all(self.trace_data.get_data(n) == 0):
stillhidden.append(n)
self.trace_plot.hideplot(*stillhidden)
self.trace_plot.request_redraw()


def OnUpdatePlot(self, e=None):
""" Update the entire plot with filters
"""
Expand Down Expand Up @@ -280,6 +304,8 @@ def ShowEvent(self, mm_id, evt_id):

else:
self.plot_window.control.Show(False)
# make sure raw traces are not plotted if user does not want them
self.OnChBoxShowRaw()
self.Layout()
self.GetParent().Layout()
wx.EndBusyCursor()
Expand Down

0 comments on commit 07d741d

Please sign in to comment.