Commit 9951c750 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[widgets] Removed chooseDimension widget from bs and hp

parent 7914dd14
Pipeline #15489 passed with stage
in 1 minute and 46 seconds
......@@ -34,7 +34,6 @@ from silx.gui.plot.StackView import StackViewMainWindow
from darfix.core.imageOperations import background_substraction
from .utils import ChooseDimensionWidget
from .operationThread import OperationThread
......@@ -54,16 +53,11 @@ class BackgroundSubstractionWidget(qt.QWidget):
self._sv = StackViewMainWindow()
self._sv.setColormap(Colormap(name='viridis', normalization='linear'))
self._chooseDimensionWidget = ChooseDimensionWidget(self)
self._chooseDimensionWidget.hide()
self._computeB = qt.QPushButton("Compute background substraction")
self.layout().addWidget(self._sv)
self.layout().addWidget(self._chooseDimensionWidget)
self.layout().addWidget(self._computeB)
self._computeB.clicked.connect(self.computeBS)
self._chooseDimensionWidget.filterChanged.connect(self._filterStack)
self._chooseDimensionWidget.stateDisabled.connect(self._wholeStack)
def hideButton(self):
self._computeB.hide()
......@@ -101,23 +95,10 @@ class BackgroundSubstractionWidget(qt.QWidget):
"""
self.dataset = dataset
self.setStack(dataset.data)
if self.dataset.get_reshaped_data() is not None:
self._chooseDimensionWidget.show()
self._chooseDimensionWidget.setDimensions(self.dataset.dims)
def clearStack(self):
self._sv.setStack(None)
def _filterStack(self, dim=0, val=0):
data = self.dataset.get_reshaped_data(dim, val)
if data.shape[0]:
self.setStack(data)
else:
self.setStack(None)
def _wholeStack(self):
self.setStack(self.dataset.data)
def setStack(self, *arg, **kwargs):
"""
Sets the data passed as aguments in the stack.
......
......@@ -34,7 +34,6 @@ from silx.gui.plot.StackView import StackViewMainWindow
from darfix.core.imageOperations import hot_pixel_removal
from .utils import ChooseDimensionWidget
from .operationThread import OperationThread
......@@ -53,15 +52,11 @@ class HotPixelRemovalWidget(qt.QWidget):
self._sv = StackViewMainWindow()
self._sv.setColormap(Colormap(name='viridis', normalization='linear'))
self._chooseDimensionWidget = ChooseDimensionWidget(self)
self._chooseDimensionWidget.hide()
self._computeB = qt.QPushButton("Compute hot pixel removal")
self.layout().addWidget(self._sv)
self.layout().addWidget(self._computeB)
self._computeB.clicked.connect(self.computeBS)
self._chooseDimensionWidget.filterChanged.connect(self._filterStack)
self._chooseDimensionWidget.stateDisabled.connect(self._wholeStack)
def hideButton(self):
self._computeB.hide()
......@@ -99,23 +94,10 @@ class HotPixelRemovalWidget(qt.QWidget):
"""
self.dataset = dataset
self.setStack(dataset.data)
if self.dataset.get_reshaped_data() is not None:
self._chooseDimensionWidget.show()
self._chooseDimensionWidget.setDimensions(self.dataset.dims)
def clearStack(self):
self._sv.setStack(None)
def _filterStack(self, dim=0, val=0):
data = self.dataset.get_reshaped_data(dim, val)
if data.shape[0]:
self.setStack(data)
else:
self.setStack(None)
def _wholeStack(self):
self.setStack(self.dataset.data)
def setStack(self, *arg, **kwargs):
"""
Sets the data passed as aguments in the stack.
......
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