Commit 802a3048 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][rsm] Add properties for pixelsize and rotate values

parent dcaaef0c
......@@ -26,7 +26,7 @@
__authors__ = ["J. Garriga"]
__license__ = "MIT"
__date__ = "04/06/2021"
__date__ = "16/07/2021"
from silx.gui import qt
......@@ -53,6 +53,7 @@ class RSMWidget(qt.QMainWindow):
self._rotate = False
self._moments = None
self._pixelSize = None
widget = qt.QWidget()
layout = qt.QGridLayout()
......@@ -66,8 +67,8 @@ class RSMWidget(qt.QMainWindow):
self._okButton.pressed.connect(self._saveRSM)
layout.addWidget(pixelSizeLabel, 0, 0)
layout.addWidget(self._pixelSizeCB, 0, 1)
layout.addWidget(self._rotateCB, 0, 2)
layout.addWidget(self._okButton, 1, 0, 1, 2)
layout.addWidget(self._rotateCB, 1, 1)
layout.addWidget(self._okButton, 2, 0, 1, 2)
widget.setLayout(layout)
self.setCentralWidget(widget)
......@@ -86,7 +87,27 @@ class RSMWidget(qt.QMainWindow):
def getDataset(self):
return self.dataset, self.indices, self.bg_indices, self.bg_dataset
@property
def pixelSize(self):
return self._pixelSize
@pixelSize.setter
def pixelSize(self, pixelSize):
self._pixelSize = pixelSize
self._pixelSizeCB.setCurrentText(str(pixelSize))
@property
def rotate(self):
return self._rotate
@rotate.setter
def rotate(self, rotate):
self._rotate = rotate
self._rotateCB.setChecked(rotate)
def _saveRSM(self):
self.dataset.compute_transformation(PixelSize[self._pixelSizeCB.currentText()].value,
self._rotateCB.isChecked())
self._pixelSize = self._pixelSizeCB.currentText()
self._rotate = self._rotateCB.isChecked()
self.dataset.compute_transformation(PixelSize[self._pixelSize].value,
self._rotate)
self.sigComputed.emit()
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