Commit 2efa7d08 authored by JosefBrandt's avatar JosefBrandt

Fix: No preview detection, while full detection is running

This messes up the progress bar....
Also: more complete blockUI and unblockUI
parent eeaa9d71
......@@ -291,6 +291,7 @@ class ParticleDetectionView(QtWidgets.QWidget):
self.seg = Segmentation(self.dataset, self)
self.seg.detectionState.connect(self.updateDetectionState)
self.thread = None
self.threadrunning = False
self.view = parent
vbox = QtWidgets.QVBoxLayout()
......@@ -315,7 +316,7 @@ class ParticleDetectionView(QtWidgets.QWidget):
self.showseedpoints.setChecked(True)
self.setImageCenter()
group = QtWidgets.QGroupBox("Detection settings", self)
self.detectParamsGroup = QtWidgets.QGroupBox("Detection settings", self)
grid = QtWidgets.QGridLayout()
self.parameters = []
checkBoxesToLink = {}
......@@ -397,8 +398,8 @@ class ParticleDetectionView(QtWidgets.QWidget):
grid.addWidget(self.showseedpoints, i+2, 0, 1, 2, QtCore.Qt.AlignLeft)
grid.addWidget(QtWidgets.QLabel("Click mouse to add seeds, Click+Shift to add deletepoints"), i+3, 0, 1, 2, QtCore.Qt.AlignLeft)
grid.addWidget(QtWidgets.QLabel("Click+Alt removes seeds near cursor"), i+4, 0, 1, 2, QtCore.Qt.AlignLeft)
group.setLayout(grid)
vbox.addWidget(group)
self.detectParamsGroup.setLayout(grid)
vbox.addWidget(self.detectParamsGroup)
self.updateSeedsInSampleViewBtn = QtWidgets.QPushButton("Update Seedpoints in fullimage view", self)
self.updateSeedsInSampleViewBtn.released.connect(self.updateSeedsInSampleview)
......@@ -600,6 +601,7 @@ class ParticleDetectionView(QtWidgets.QWidget):
self.updateImageSeeds()
def detectShow(self, showname):
if not self.threadrunning:
self.saveDetectParams(self.dataset)
img = self.subimg.copy()
kwargs = {}
......@@ -637,10 +639,16 @@ class ParticleDetectionView(QtWidgets.QWidget):
def blockUI(self):
self.pdetectsub.setEnabled(False)
self.pclear.setEnabled(False)
self.detectParamsGroup.setEnabled(False)
self.updateSeedsInSampleViewBtn.setEnabled(False)
self.hideSeedsInSampleViewBtn.setEnabled(False)
def unBlockUI(self):
self.pdetectsub.setEnabled(True)
self.pclear.setEnabled(True)
self.detectParamsGroup.setEnabled(True)
self.updateSeedsInSampleViewBtn.setEnabled(True)
self.hideSeedsInSampleViewBtn.setEnabled(True)
def raiseWarning(self, warning):
QtWidgets.QMessageBox.critical(self, "Warning", warning)
......
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