Skip to content
Snippets Groups Projects
Commit 68badbca authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Removed showOverlay option from HistogramPanel - it is to be an option

on the HistogramSeries class.
parent ac93f9d0
No related branches found
No related tags found
No related merge requests found
...@@ -246,16 +246,15 @@ properties = TypeDict({ ...@@ -246,16 +246,15 @@ properties = TypeDict({
'TimeSeriesPanel.usePixdim' : 'Use pixdims', 'TimeSeriesPanel.usePixdim' : 'Use pixdims',
'TimeSeriesPanel.showCurrent' : 'Plot time series for current voxel', 'TimeSeriesPanel.showCurrent' : 'Plot time series for current voxel',
'HistogramPanel.histType' : 'Histogram type', 'HistogramPanel.histType' : 'Histogram type',
'HistogramPanel.autoBin' : 'Automatic histogram binning', 'HistogramPanel.autoBin' : 'Automatic histogram binning',
'HistogramPanel.showCurrent' : 'Plot histogram for current overlay', 'HistogramPanel.showCurrent' : 'Plot histogram for current overlay',
'HistogramPanel.enableOverlay' : 'Enable 3D histogram overlay',
'HistogramSeries.nbins' : 'Number of bins', 'HistogramSeries.nbins' : 'Number of bins',
'HistogramSeries.ignoreZeros' : 'Ignore zeros', 'HistogramSeries.ignoreZeros' : 'Ignore zeros',
'HistogramSeries.volume' : 'Volume', 'HistogramSeries.volume' : 'Volume',
'HistogramSeries.dataRange' : 'Data range', 'HistogramSeries.dataRange' : 'Data range',
'HistogramSeries.showOverlay' : 'Show 3D histogram overlay',
'OrthoEditProfile.selectionSize' : 'Selection size', 'OrthoEditProfile.selectionSize' : 'Selection size',
'OrthoEditProfile.selectionIs3D' : '3D selection', 'OrthoEditProfile.selectionIs3D' : '3D selection',
......
...@@ -25,32 +25,28 @@ class HistogramControlPanel(fslpanel.FSLViewPanel): ...@@ -25,32 +25,28 @@ class HistogramControlPanel(fslpanel.FSLViewPanel):
self, overlayList, displayCtx, hsPanel) self, overlayList, displayCtx, hsPanel)
self.__plotControl.SetWindowStyleFlag(wx.SUNKEN_BORDER) self.__plotControl.SetWindowStyleFlag(wx.SUNKEN_BORDER)
self.__histType = props.makeWidget(self, hsPanel, 'histType')
self.__autoBin = props.makeWidget(self, hsPanel, 'autoBin') self.__autoBin = props.makeWidget(self, hsPanel, 'autoBin')
self.__showCurrent = props.makeWidget(self, hsPanel, 'showCurrent') self.__showCurrent = props.makeWidget(self, hsPanel, 'showCurrent')
self.__histType = props.makeWidget(self, hsPanel, 'histType')
self.__enableOverlay = props.makeWidget(self, hsPanel, 'enableOverlay')
self.__histTypeLabel = wx.StaticText(self) self.__histTypeLabel = wx.StaticText(self)
self.__histTypeLabel.SetLabel(strings.properties[hsPanel,
'histType'])
self.__autoBin .SetLabel(strings.properties[hsPanel, self.__autoBin .SetLabel(strings.properties[hsPanel,
'autoBin']) 'autoBin'])
self.__showCurrent .SetLabel(strings.properties[hsPanel, self.__showCurrent .SetLabel(strings.properties[hsPanel,
'showCurrent']) 'showCurrent'])
self.__enableOverlay.SetLabel(strings.properties[hsPanel,
'enableOverlay'])
self.__histTypeLabel.SetLabel(strings.properties[hsPanel,
'histType'])
self.__htSizer = wx.BoxSizer(wx.HORIZONTAL) self.__htSizer = wx.BoxSizer(wx.HORIZONTAL)
self.__htSizer.Add(self.__histTypeLabel, flag=wx.EXPAND) self.__htSizer.Add(self.__histTypeLabel, flag=wx.EXPAND)
self.__htSizer.Add(self.__histType, flag=wx.EXPAND, proportion=1) self.__htSizer.Add(self.__histType, flag=wx.EXPAND, proportion=1)
self.__optSizer = wx.GridSizer(2, 2) self.__optSizer = wx.GridSizer(1, 3)
self.__optSizer.Add(self.__htSizer, flag=wx.EXPAND)
self.__optSizer.Add(self.__autoBin, flag=wx.EXPAND) self.__optSizer.Add(self.__autoBin, flag=wx.EXPAND)
self.__optSizer.Add(self.__showCurrent, flag=wx.EXPAND) self.__optSizer.Add(self.__showCurrent, flag=wx.EXPAND)
self.__optSizer.Add(self.__htSizer, flag=wx.EXPAND)
self.__optSizer.Add(self.__enableOverlay, flag=wx.EXPAND)
self.__sizer = wx.BoxSizer(wx.VERTICAL) self.__sizer = wx.BoxSizer(wx.VERTICAL)
self.SetSizer(self.__sizer) self.SetSizer(self.__sizer)
......
...@@ -54,6 +54,7 @@ class HistogramSeries(plotpanel.DataSeries): ...@@ -54,6 +54,7 @@ class HistogramSeries(plotpanel.DataSeries):
nbins = props.Int(minval=10, maxval=500, default=100, clamped=True) nbins = props.Int(minval=10, maxval=500, default=100, clamped=True)
ignoreZeros = props.Boolean(default=True) ignoreZeros = props.Boolean(default=True)
showOverlay = props.Boolean(default=False)
volume = props.Int(minval=0, maxval=0, clamped=True) volume = props.Int(minval=0, maxval=0, clamped=True)
dataRange = props.Bounds( dataRange = props.Bounds(
ndims=1, ndims=1,
...@@ -152,10 +153,9 @@ class HistogramSeries(plotpanel.DataSeries): ...@@ -152,10 +153,9 @@ class HistogramSeries(plotpanel.DataSeries):
class HistogramPanel(plotpanel.PlotPanel): class HistogramPanel(plotpanel.PlotPanel):
autoBin = props.Boolean(default=True) autoBin = props.Boolean(default=True)
showCurrent = props.Boolean(default=True) showCurrent = props.Boolean(default=True)
enableOverlay = props.Boolean(default=False) histType = props.Choice(('probability', 'count'))
histType = props.Choice(('probability', 'count'))
def __init__(self, parent, overlayList, displayCtx): def __init__(self, parent, overlayList, displayCtx):
...@@ -188,10 +188,10 @@ class HistogramPanel(plotpanel.PlotPanel): ...@@ -188,10 +188,10 @@ class HistogramPanel(plotpanel.PlotPanel):
# HistogramPanel property changes. # HistogramPanel property changes.
self.addGlobalListener(self._name, self.draw) self.addGlobalListener(self._name, self.draw)
# But a separate listener for autoBin - # Custom listener for autoBin - this
# this overwrites the one added by the # overwrites the one added by the
# addGlobalListener method above. See # addGlobalListener method above.
# the __autoBinChanged method. # See the __autoBinChanged method.
self.addListener('autoBin', self.addListener('autoBin',
self._name, self._name,
self.__autoBinChanged, self.__autoBinChanged,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment