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

[gui][shift] Use input checkbox to choose when to apply shift to only selected value

parent 4d09651c
...@@ -236,13 +236,13 @@ class ShiftCorrectionWidget(qt.QMainWindow): ...@@ -236,13 +236,13 @@ class ShiftCorrectionWidget(qt.QMainWindow):
self._inputDock.widget.correctionB.setEnabled(False) self._inputDock.widget.correctionB.setEnabled(False)
def _filterStack(self, dim=0, val=0): def _filterStack(self, dim=0, val=0):
self._inputDock.widget.checkbox.show()
self._dimension = [dim, val] self._dimension = [dim, val]
data = self._update_dataset.get_data(self.indices, self._dimension) data = self._update_dataset.get_data(self.indices, self._dimension)
if self.dataset.dims.ndim == 2: if self.dataset.dims.ndim == 2:
stack_size = self.dataset.dims.get(dim[0]).size stack_size = self.dataset.dims.get(dim[0]).size
reset_shift = self._filtered_shift is None or self._filtered_shift.shape[0] != stack_size reset_shift = self._filtered_shift is None or self._filtered_shift.shape[0] != stack_size
self._inputDock.widget.checkbox.show()
self._filtered_shift = numpy.zeros((stack_size, 2)) if reset_shift else self._filtered_shift self._filtered_shift = numpy.zeros((stack_size, 2)) if reset_shift else self._filtered_shift
self.shift = self._filtered_shift[val[0]] self.shift = self._filtered_shift[val[0]]
if data.shape[0]: if data.shape[0]:
...@@ -316,8 +316,8 @@ class _InputWidget(qt.QWidget): ...@@ -316,8 +316,8 @@ class _InputWidget(qt.QWidget):
self.correctionB = qt.QPushButton("Correct") self.correctionB = qt.QPushButton("Correct")
self.abortB = qt.QPushButton("Abort") self.abortB = qt.QPushButton("Abort")
self.abortB.hide() self.abortB.hide()
self.checkbox = qt.QCheckBox("Apply to whole dataset") self.checkbox = qt.QCheckBox("Apply only to selected value")
self.checkbox.setChecked(True) self.checkbox.setChecked(False)
self.checkbox.hide() self.checkbox.hide()
self.dxLE.setValidator(qt.QDoubleValidator()) self.dxLE.setValidator(qt.QDoubleValidator())
......
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