Commit 439687ad authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][magnification] Update widget to use correct dataset method

parent 4fa69f53
......@@ -26,7 +26,7 @@
__authors__ = ["J. Garriga"]
__license__ = "MIT"
__date__ = "02/06/2021"
__date__ = "04/06/2021"
from silx.gui import qt
......@@ -34,7 +34,7 @@ from silx.gui import qt
class MagnificationWidget(qt.QMainWindow):
"""
Widget to apply PCA to a set of images and plot the eigenvalues found.
Widget to apply magnification transformation to the data axes.
"""
sigComputed = qt.Signal()
......@@ -80,7 +80,15 @@ class MagnificationWidget(qt.QMainWindow):
self.indices = indices
self.bg_indices = bg_indices
self.bg_dataset = bg_dataset
self._okButton.setEnabled(True)
if not self.dataset.dims:
msg = qt.QMessageBox()
msg.setIcon(qt.QMessageBox.Warning)
msg.setText("This widget has to be used before selecting any region of \
interest and after selecting the dimensions")
msg.exec_()
else:
self._okButton.setEnabled(True)
def getDataset(self):
return self.dataset, self.indices, self.bg_indices, self.bg_dataset
......@@ -108,9 +116,9 @@ class MagnificationWidget(qt.QMainWindow):
def _saveMagnification(self):
if self._checkbox2x.isChecked():
self.dataset.magnification = 0.00375
d = 3.75
elif self._checkbox10x.isChecked():
self.dataset.magnification = 0.00075
d = 0.75
else:
magnification = self._manualLE.text()
if magnification == "":
......@@ -119,7 +127,7 @@ class MagnificationWidget(qt.QMainWindow):
msg.setText("Magnification value has to be entered when choosing manual")
msg.exec_()
return
else:
self.dataset.magnification = float(magnification)
self.dataset.compute_transformation(d)
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