Commit 1a1c6f98 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui] Use high intensity data

parent 11803013
......@@ -28,6 +28,8 @@ __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
......@@ -70,7 +72,13 @@ class BackgroundSubstractionWidget(qt.QWidget):
Function that starts the thread to compute the background
substraction.
"""
self._thread.setArgs(self.dataset.data, self.dataset.dark_frames)
if self.dataset.dark_frames:
self._thread.setArgs(self.dataset.hi_data, self.dataset.dark_frames)
elif numpy.any(self.dataset.li_data):
self._thread.setArgs(self.dataset.hi_data, self.dataset.li_data)
else:
self._thread.setArgs(self.dataset.data, self.dataset.data)
self._thread.finished.connect(self._updateData)
self._thread.start()
self._computeB.setEnabled(False)
......@@ -81,9 +89,9 @@ class BackgroundSubstractionWidget(qt.QWidget):
"""
self._thread.finished.disconnect(self._updateData)
self._computeB.setEnabled(True)
self.dataset.data = self._thread.data
assert self.dataset.data is not None
self.setStack(self.dataset.data)
self.dataset.hi_data = self._thread.data
assert self.dataset.hi_data is not None
self.setStack(self.dataset.hi_data)
self.signalComputed.emit()
def setDataset(self, dataset):
......@@ -94,7 +102,7 @@ class BackgroundSubstractionWidget(qt.QWidget):
:param Dataset dataset: dataset
"""
self.dataset = dataset
self.setStack(dataset.data)
self.setStack(dataset.hi_data)
def clearStack(self):
self._sv.setStack(None)
......
......@@ -68,7 +68,7 @@ class HotPixelRemovalWidget(qt.QWidget):
"""
Function that starts the thread to compute the hot pixel removal.
"""
self._thread.setArgs(self.dataset.data)
self._thread.setArgs(self.dataset.hi_data)
self._thread.finished.connect(self._updateData)
self._thread.start()
self._computeB.setEnabled(False)
......@@ -79,10 +79,9 @@ class HotPixelRemovalWidget(qt.QWidget):
"""
self._thread.finished.disconnect(self._updateData)
self._computeB.setEnabled(True)
self.dataset.data = self._thread.data
# self.dataset.data = hot_pixel_removal(self.dataset.data)
assert self.dataset.data is not None
self.setStack(self.dataset.data)
self.dataset.hi_data = self._thread.data
assert self.dataset.hi_data is not None
self.setStack(self.dataset.hi_data)
self.signalComputed.emit()
def setDataset(self, dataset):
......@@ -93,7 +92,7 @@ class HotPixelRemovalWidget(qt.QWidget):
:param Dataset dataset: dataset
"""
self.dataset = dataset
self.setStack(dataset.data)
self.setStack(dataset.hi_data)
def clearStack(self):
self._sv.setStack(None)
......
......@@ -91,7 +91,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
:param Dataset dataset: dataset
"""
self.dataset = dataset
self.setStack(dataset.data)
self.setStack(dataset.hi_data)
self._inputDock.widget.correctionB.setEnabled(True)
if self.dataset.reshaped_data is not None:
self._chooseDimensionDock.show()
......@@ -106,7 +106,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
dy = self._inputDock.widget.getDy()
self.shift = [dx, dy]
if self._shift2dataset:
data = self.dataset.data
data = self.dataset.hi_data
else:
data = self.dataset.get_reshaped_data(self.dimension, self.value)
frames = numpy.arange(data.shape[0])
......@@ -173,7 +173,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
def _wholeStack(self):
self._inputDock.widget.checkbox.hide()
self.setStack(self.dataset.data)
self.setStack(self.dataset.hi_data)
def getStack(self):
"""
......
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