Commit 98e40ded authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui][pca] Docs

parent 7384d908
Pipeline #18030 passed with stage
in 3 minutes and 42 seconds
......@@ -26,7 +26,7 @@
__authors__ = ["J. Garriga"]
__license__ = "MIT"
__date__ = "03/12/2019"
__date__ = "04/12/2019"
import numpy
......@@ -40,7 +40,7 @@ from .operationThread import OperationThread
class PCAWidget(qt.QWidget):
"""
Widget to apply PCA to a set of images and ploat the eigenvalues found.
Widget to apply PCA to a set of images and plot the eigenvalues found.
"""
signalComputed = qt.Signal()
......@@ -50,32 +50,29 @@ class PCAWidget(qt.QWidget):
self.setLayout(qt.QVBoxLayout())
self._plot = Plot1D()
# self._plot.setColormap(Colormap(name='jet', normalization='linear'))
self.layout().addWidget(self._plot)
def setDataset(self, dataset):
"""
Dataset setter. Saves the dataset and updates the stack with the dataset
data
Dataset setter. Starts BSS class and initalizes thread.
:param Dataset dataset: dataset
"""
self.dataset = dataset
self.BSS = BSS(self.dataset.hi_data)
self._thread = OperationThread(self.BSS.PCA)
self.computePCA()
self._computePCA()
def computePCA(self):
def _computePCA(self):
"""
Function that starts the thread to compute the background
substraction.
Slot that starts the thread to compute PCA.
"""
self._thread.finished.connect(self._updateData)
self._thread.start()
def _updateData(self):
"""
Updates the stack with the data computed in the thread
Plots the eigenvalues.
"""
self._thread.finished.disconnect(self._updateData)
mean, vecs, vals = self._thread.data
......
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