Commit ad95af53 authored by Josef Brandt's avatar Josef Brandt

Hotfix in legacyConvert, ComfortUpdates

parent a10389ae
......@@ -209,6 +209,7 @@ class GEPARDMainWindow(QtWidgets.QMainWindow):
self.fullOverlayAct = QtWidgets.QAction("&Full Overlay", self)
self.transpAct = QtWidgets.QAction("&Transparent Overlay", self)
self.hideLabelAct = QtWidgets.QAction('&Hide Spectra Numbers', self)
self.hideLabelAct.setShortcut("H")
self.darkenAct = QtWidgets.QAction("&Darken Image", self)
self.seedAct = QtWidgets.QAction("&Set Color Seed", self)
......
......@@ -275,4 +275,8 @@ class SpectraPlot(QtWidgets.QGroupBox):
self.reference_axis.tick_params('y', colors = 'r')
self.reference_axis.set_xbound(100, (3400 if self.spectra[-1, 0] > 3400 else self.spectra[-1, 0]))
self.canvas.draw()
def clearReferenceSpectrum(self):
self.reference_axis.clear()
self.canvas.draw()
\ No newline at end of file
......@@ -358,10 +358,13 @@ class ParticleAnalysis(QtWidgets.QMainWindow):
assignment = self.particleContainer.getParticleAssignmentByIndex(self.currentParticleIndex)
self.specPlot.updateParticleSpectrum(self.currentSpectrumIndex, assignment, hqi)
if self.refSelector.isEnabled() and self.refSelector.currentText() != '':
refID = self.dbWin.activeDatabase.spectraNames.index(self.refSelector.currentText())
ref = self.dbWin.activeDatabase.spectra[refID]
self.specPlot.updateReferenceSpectrum(ref[:, 0], ref[:, 1])
if self.refSelector.isEnabled():
if self.refSelector.currentText() != '':
refID = self.dbWin.activeDatabase.spectraNames.index(self.refSelector.currentText())
ref = self.dbWin.activeDatabase.spectra[refID]
self.specPlot.updateReferenceSpectrum(ref[:, 0], ref[:, 1])
else:
self.specPlot.clearReferenceSpectrum()
def updateContourColors(self):
"""
......
......@@ -111,6 +111,8 @@ class PolymerNavigationToolbar(QtWidgets.QGroupBox):
self.particleContainer = particleContainer
self.currentSpectrumIndex = None
self.currentParticleIndex = None
self.lastSpecIndex = None
self.lastParticleIndex = None
self.createWidgets()
......@@ -167,6 +169,9 @@ class PolymerNavigationToolbar(QtWidgets.QGroupBox):
"""
uniquePolymers = self.particleContainer.getUniquePolymers()
if len(uniquePolymers) > 0:
self.lastSpecIndex = self.currentSpectrumIndex
self.lastParticleIndex = self.currentParticleIndex
self.setDisabled(False)
self.typeSelectorCombo.currentIndexChanged.disconnect()
self.typeSelectorCombo.clear()
......@@ -227,6 +232,10 @@ class PolymerNavigationToolbar(QtWidgets.QGroupBox):
def setParticleSelector(self):
assignment = self.typeSelectorCombo.currentText()
if assignment != '':
# if self.lastParticleIndex is not None:
# self.currentParticleIndex = self.lastParticleIndex
# self.lastParticleIndex = None
# else:
partIndices = self.particleContainer.getIndicesOfParticleType(assignment)
self.currentParticleIndex = partIndices[self.particleSelector.value()-1]
......@@ -237,12 +246,22 @@ class PolymerNavigationToolbar(QtWidgets.QGroupBox):
self.setSpecSelector()
def setSpecSelector(self):
# if self.lastSpecIndex is not None:
# self.currentSpectrumIndex = self.lastSpecIndex
# self.lastSpecIndex = None
# else:
specIndices = self.particleContainer.getSpectraIndicesOfParticle(self.currentParticleIndex)
self.currentSpectrumIndex = specIndices[self.spectrumSelector.value()-1]
self.specNumberSelector.setValue(self.currentSpectrumIndex+1)
self.WidgetsUpdated.emit()
self.JumpToIndicatedSpec.emit()
if self.lastSpecIndex is not None:
self.currentParticleIndex = self.particleContainer.getParticleIndexContainingSpecIndex(self.lastSpecIndex)
self.lastSpecIndex = None
self.setWidgetsToNewParticleIndex(self.currentParticleIndex)
class FindColoredParticleWindow(QtWidgets.QWidget):
......
......@@ -144,6 +144,6 @@ class Fibre(BaseShape):
def __init__(self):
super(Fibre, self).__init__()
self.name = 'fibre'
self.aspectRatioRange = [3, 1000]
self.aspectRatioRange = [5, 1000]
self.solidityRange = [0.0, 0.4]
self.height2AverageLengthRange = [0, 1000]
\ No newline at end of file
......@@ -189,6 +189,7 @@ def updateParticleStats(dset):
particle.shape = pc.getParticleShape(particle.contour, particle.height, shapeClassifier)
except InvalidParticleError:
markForDeletion(particle)
continue
if particle.shape == 'fibre':
particle.longSize, particle.shortSize = pc.getFibreDimension(particle.contour)
......
......@@ -289,6 +289,7 @@ class SampleView(QtWidgets.QGraphicsView):
tryDisconnectingSignal(self.particleEditor.particleAssignmentChanged)
if self.analysiswidget is not None:
self.particleEditor.particleAssignmentChanged.connect(self.analysiswidget.updatePlotsAndContours)
self.particleEditor.particleAssignmentChanged.connect(self.analysiswidget.updateWidgetContents)
def setMicroscopeMode(self):
"""
......
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