Commit b5a0b53e authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui] If dimension has no data, set stack to None

parent 8964190e
Pipeline #14667 passed with stage
in 1 minute and 28 seconds
......@@ -28,8 +28,6 @@ __authors__ = ["J. Garriga"]
__license__ = "MIT"
__date__ = "08/08/2019"
import numpy
from silx.gui import qt
from silx.gui.colors import Colormap
from silx.gui.plot.StackView import StackViewMainWindow
......@@ -104,7 +102,7 @@ class BackgroundSubstractionWidget(qt.QWidget):
"""
self.dataset = dataset
self.setStack(dataset.data)
if self.dataset.reshaped_data is not None:
if self.dataset.reshaped_data() is not None:
self._chooseDimensionWidget.show()
self._chooseDimensionWidget.setDimensions(self.dataset.dims)
......@@ -112,7 +110,11 @@ class BackgroundSubstractionWidget(qt.QWidget):
self._sv.setStack(None)
def _filterStack(self, dim=0, val=0):
self.setStack(numpy.take(self.dataset.reshaped_data, val, axis=dim))
data = self.dataset.reshaped_data(dim, val)
if data.shape[0]:
self.setStack(data)
else:
self.setStack(None)
def _wholeStack(self):
self.setStack(self.dataset.data)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment