Commit a41271eb authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[gui] Modified signals name for code cross coherence

parent 43246115
......@@ -74,7 +74,7 @@ class Dataset(qt.QObject):
after the creation of the file_series. It waits until the load_data()
method is called.
"""
signalProgress = qt.Signal(int)
sigProgressChanged = qt.Signal(int)
def __init__(self, raw_filename=None, dark_filename=None, filenames=None,
filter_data=False, load_data=True):
......@@ -89,6 +89,7 @@ class Dataset(qt.QObject):
self.dark_filename = dark_filename
self.filenames = filenames
self.__dims = AcquisitionDims()
# Keys: dimensions names, values: dimensions values
self._dimensions_values = {}
# Initialize data
......@@ -119,7 +120,7 @@ class Dataset(qt.QObject):
data_urls.append(DataUrl(file_path=frame.filename,
scheme='fabio').path())
self.metadata.append(fabioh5.EdfFabioReader(fabio_image=frame))
self.signalProgress.emit(int(percentage * iFrame / self._file_series.nframes * 100))
self.sigProgressChanged.emit(int(percentage * iFrame / self._file_series.nframes * 100))
self.data_urls = numpy.array(data_urls)
......@@ -137,7 +138,7 @@ class Dataset(qt.QObject):
intensity = []
for i, frame in enumerate(self.data):
intensity += [cv2.GaussianBlur(frame, (3, 3), 20).var()]
self.signalProgress.emit(int(start + percentage * i / len(self.data) * 100))
self.sigProgressChanged.emit(int(start + percentage * i / len(self.data) * 100))
values, bins = numpy.histogram(intensity, int(self._data.shape[0]))
self.threshold = numpy.array(intensity) >= bins[1]
......@@ -172,7 +173,7 @@ class Dataset(qt.QObject):
percentage /= 2
for i, url in enumerate(self.data_urls):
data += [utils.get_data(url)]
self.signalProgress.emit(int(start + ((percentage * i) / len(self.data_urls) * 100)))
self.sigProgressChanged.emit(int(start + ((percentage * i) / len(self.data_urls) * 100)))
self._data = numpy.array(data)
if self._filter_data:
self.compute_intensity_threshold(percentage / 2, start=start + (percentage * 100))
......
......@@ -42,7 +42,7 @@ class PCAWidget(qt.QMainWindow):
"""
Widget to apply PCA to a set of images and plot the eigenvalues found.
"""
signalComputed = qt.Signal()
sigComputed = qt.Signal()
def __init__(self, parent=None):
qt.QWidget.__init__(self, parent)
......@@ -102,4 +102,4 @@ class PCAWidget(qt.QMainWindow):
vals = [item for sublist in vals for item in sublist]
self._plot.show()
self._plot.addCurve(numpy.arange(len(vals)), vals, symbol='.', linestyle=' ')
self.signalComputed.emit()
self.sigComputed.emit()
......@@ -41,7 +41,6 @@ class BSSWidget(qt.QMainWindow):
"""
Widget to apply blind source separation.
"""
signalComputed = qt.Signal()
def __init__(self, parent=None):
qt.QMainWindow.__init__(self, parent)
......
......@@ -45,7 +45,7 @@ class DatasetSelectionWidget(qt.QTabWidget):
If both options are filled up, only the files in the list of filenames
are read.
"""
signalProgress = qt.Signal(int)
sigProgressChanged = qt.Signal(int)
def __init__(self, parent=None):
qt.QTabWidget.__init__(self, parent)
......@@ -90,7 +90,7 @@ class DatasetSelectionWidget(qt.QTabWidget):
self._dataset = Dataset(filenames=self._rawFilesData.getFiles(),
dark_filename=self._darkFilenameData.getFilename(),
load_data=False, filter_data=self._filterData)
self._dataset.signalProgress.connect(self.updateProgress)
self._dataset.sigProgressChanged.connect(self.updateProgress)
_logger.info("Loading data urls")
self._dataset.load_data(0.3)
_logger.info("Loading data")
......@@ -102,7 +102,7 @@ class DatasetSelectionWidget(qt.QTabWidget):
return self._dataset
def updateProgress(self, progress):
self.signalProgress.emit(progress)
self.sigProgressChanged.emit(progress)
def __filterData(self, filterData):
self._filterData = filterData
......
......@@ -44,7 +44,6 @@ class DisplayComponentsWidget(qt.QMainWindow):
"""
Widget to apply blind source separation.
"""
signalComputed = qt.Signal()
def __init__(self, parent=None):
qt.QMainWindow.__init__(self, parent)
......
......@@ -50,7 +50,7 @@ class ROISelectionWidget(qt.QWidget):
"""
Widget that allows the user to pick a ROI in any image of the dataset.
"""
signalComputed = qt.Signal(list, list)
sigComputed = qt.Signal(list, list)
def __init__(self, parent=None):
qt.QWidget.__init__(self, parent)
......@@ -178,9 +178,9 @@ class ROISelectionWidget(qt.QWidget):
if len(self.dataset.dark_frames):
self.dataset.dark_frames = apply_3D_ROI(self.dataset.dark_frames,
self.roi.getSize() / 2, numpy.flip(self.roi.getCenter()))
self.signalComputed.emit(self.roi.getOrigin().tolist(), self.roi.getSize().tolist())
self.sigComputed.emit(self.roi.getOrigin().tolist(), self.roi.getSize().tolist())
else:
self.signalComputed.emit([], [])
self.sigComputed.emit([], [])
def resetROI(self):
"""
......
......@@ -46,8 +46,8 @@ class ShiftCorrectionWidget(qt.QMainWindow):
"""
A widget to apply shift correction to a stack of images
"""
signalComputed = qt.Signal()
signalProgress = qt.Signal(int)
sigComputed = qt.Signal()
sigProgressChanged = qt.Signal(int)
def __init__(self, parent=None):
qt.QMainWindow.__init__(self, parent)
......@@ -120,7 +120,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
self.thread_correction.start()
def updateProgress(self, progress):
self.signalProgress.emit(progress)
self.sigProgressChanged.emit(progress)
def _changeDataShiftFlag(self, state):
self._shift2dataset = state
......@@ -145,7 +145,7 @@ class ShiftCorrectionWidget(qt.QMainWindow):
data = self.thread_correction.data
assert data is not None
self.setStack(data)
self.signalComputed.emit()
self.sigComputed.emit()
if self._shift2dataset:
self.dataset.hi_dataset = data
......
......@@ -70,7 +70,7 @@ class DataSelectionWidgetOW(OWWidget):
self.controlArea.layout().addWidget(_buttons)
self._progressBar = gui.ProgressBar(self, 100)
self._widget.signalProgress.connect(self._updateProgress)
self._widget.sigProgressChanged.connect(self._updateProgress)
_buttons.accepted.connect(self._getDataset)
self.__updatingData = False
......
......@@ -64,7 +64,7 @@ class RoiSelectionWidgetOW(OWWidget):
# self._button.setEnabled(False)
self.controlArea.layout().addWidget(self._widget)
# self.controlArea.layout().addWidget(self._button)
self._widget.signalComputed.connect(self._sendSignal)
self._widget.sigComputed.connect(self._sendSignal)
# self._button.pressed.connect(self._createRoi)
......
......@@ -61,8 +61,8 @@ class ShiftCorrectionWidgetOW(OWWidget):
self._widget = ShiftCorrectionWidget(parent=self)
self._progressBar = gui.ProgressBar(self, 100)
self._widget.signalComputed.connect(self._sendSignal)
self._widget.signalProgress.connect(self._updateProgress)
self._widget.sigComputed.connect(self._sendSignal)
self._widget.sigProgressChanged.connect(self._updateProgress)
self.controlArea.layout().addWidget(self._widget)
if self.shift:
......
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