Commit 9c914480 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][noiseremoval] Add step and chunks properties

parent 148e2aa4
......@@ -219,10 +219,13 @@ class NoiseRemovalWidget(qt.QMainWindow):
self._sv.setColormap(Colormap(name=darfix.config.DEFAULT_COLORMAP_NAME,
normalization=darfix.config.DEFAULT_COLORMAP_NORM))
self._size = self._parametersDock.hpSizeCB.currentText()
self._method = self._parametersDock.bsMethodsCB.currentText()
self._size = None
self._method = None
self._background = self._parametersDock.bsBackgroundCB.currentText()
self._bottom_threshold = self._parametersDock.bottomLE.text()
self._step = self._parametersDock.step.text()
self._chunks = [int(self._parametersDock.verticalChunkSize.text()),
int(self._parametersDock.horizontalChunkSize.text())]
self.setCentralWidget(self._sv)
self.addDockWidget(qt.Qt.BottomDockWidgetArea, self._parametersDock)
......@@ -277,18 +280,18 @@ class NoiseRemovalWidget(qt.QMainWindow):
else:
bg = None
chunks = None
step = None
self._chunks = None
self._step = None
if self._parametersDock.inDiskWidget.isVisible():
if self._parametersDock.inDiskCheckbox.isChecked():
chunks = [int(self._parametersDock.verticalChunkSize.text()),
self._chunks = [int(self._parametersDock.verticalChunkSize.text()),
int(self._parametersDock.horizontalChunkSize.text())]
else:
step = int(self._parametersDock.step.text())
self._step = int(self._parametersDock.step.text())
self._thread = OperationThread(self, self._update_dataset.apply_background_subtraction)
self._method = self._parametersDock.bsMethodsCB.currentText()
self._thread.setArgs(bg, self._method, self.indices, step, chunks)
self._thread.setArgs(bg, self._method, self.indices, self._step, self._chunks)
self._thread.finished.connect(self._updateData)
if not self._update_dataset.in_memory:
self._parametersDock.abortBS.show()
......@@ -443,6 +446,27 @@ class NoiseRemovalWidget(qt.QMainWindow):
self._method = method
self._parametersDock.bsMethodsCB.setCurrentText(method)
@property
def step(self):
return self._step
@method.setter
def step(self, step):
self._step = step
if step is not None:
self._parametersDock.step.setCurrentText(step)
@property
def chunks(self):
return self._chunks
@method.setter
def chunks(self, chunks):
self._chunks = chunks
if chunks is not None:
self._parametersDock.verticalChunkSize.setCurrentText(chunks[0])
self._parametersDock.horizontalChunkSize.setCurrentText(chunks[1])
@property
def background(self):
return self._background
......
Markdown is supported
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