Commit 76447d0a authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui] Added option to set new data only in certain position of the data

parent eb17c168
Pipeline #15014 passed with stage
in 1 minute and 38 seconds
......@@ -102,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.get_reshaped_data() is not None:
self._chooseDimensionWidget.show()
self._chooseDimensionWidget.setDimensions(self.dataset.dims)
......@@ -110,7 +110,7 @@ class BackgroundSubstractionWidget(qt.QWidget):
self._sv.setStack(None)
def _filterStack(self, dim=0, val=0):
data = self.dataset.reshaped_data(dim, val)
data = self.dataset.get_reshaped_data(dim, val)
if data.shape[0]:
self.setStack(data)
else:
......
......@@ -86,7 +86,7 @@ class ShiftCorrectionWidget(qt.QWidget):
self.dataset = dataset
self.setStack(dataset.data)
self._inputW.correctionB.setEnabled(True)
if self.dataset.reshaped_data() is not None:
if self.dataset.get_reshaped_data() is not None:
self._chooseDimensionWidget.show()
self._chooseDimensionWidget.setDimensions(self.dataset.dims)
......@@ -98,8 +98,12 @@ class ShiftCorrectionWidget(qt.QWidget):
dx = self._inputW.getDx()
dy = self._inputW.getDy()
self.shift = [dx, dy]
frames = numpy.arange(self.dataset.data.shape[0])
self.thread_correction.setArgs(self.dataset.data, numpy.outer(self.shift, frames))
if self._shift2dataset:
data = self.dataset.data
else:
data = self.dataset.get_reshaped_data(self.dimension, self.value)
frames = numpy.arange(data.shape[0])
self.thread_correction.setArgs(data, numpy.outer(self.shift, frames))
self.thread_correction.finished.connect(self._updateData)
self._inputW.correctionB.setEnabled(False)
self.thread_correction.start()
......@@ -133,9 +137,9 @@ class ShiftCorrectionWidget(qt.QWidget):
self.signalComputed.emit()
if self._shift2dataset:
self.dataset.hi_dataset = self.thread_correction.data
self.dataset.hi_dataset = data
else:
print("NOT IMPLEMENTED")
self.dataset.set_reshaped_data(data, self.dimension, self.value)
def setStack(self, *arg, **kwargs):
"""
......@@ -154,7 +158,7 @@ class ShiftCorrectionWidget(qt.QWidget):
self._inputW.checkbox.show()
self.dimension = dim
self.value = val
data = self.dataset.reshaped_data(dim, val)
data = self.dataset.get_reshaped_data(dim, val)
if data.shape[0]:
self.setStack(data)
else:
......
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