Commit f3c17ebf authored by Josef Brandt's avatar Josef Brandt

Renaming into SpecScans, several bugfixes

parent 9120c7ba
__pycache__/ __pycache__/
gepard\.cfg gepard\.cfg
analysis/database_config\.txt analysis/database_config\.txt
*.so *.so
*.c *.c
external/build/ external/build/
.idea/ .idea/
*.pyd *.pyd
ramancom/renishawcom.py instrumentcom/renishawcom.py
ramancom/renishawtesting.py instrumentcom/renishawtesting.py
*.exp *.exp
......
...@@ -21,7 +21,7 @@ Requirements: ...@@ -21,7 +21,7 @@ Requirements:
for 64bit as many use cases require a lot of memory (16 GB better 32 GB for 64bit as many use cases require a lot of memory (16 GB better 32 GB
recommended) recommended)
* the tsp module in external can be built with * the cython modules can be built with
python setuptsp.py python setuptsp.py
please note: for this step a valid compiler needs to be installed in the please note: for this step a valid compiler needs to be installed in the
system; Otherwise use the precompiled tsp-module system; Otherwise use the precompiled tsp-module
......
...@@ -27,12 +27,13 @@ from typing import List ...@@ -27,12 +27,13 @@ from typing import List
from PyQt5 import QtCore, QtWidgets, QtGui from PyQt5 import QtCore, QtWidgets, QtGui
from .sampleview import SampleView from .sampleview import SampleView
from .gui.scalebar import ScaleBar from .gui.scalebar import ScaleBar
from .ramancom.ramancontrol import defaultPath from .instrumentcom.instrumentConfig import defaultPath
from .ramancom.lightModeSwitch import LightModeSwitch from .instrumentcom.lightModeSwitch import LightModeSwitch
from .gui.colorlegend import ColorLegend from .gui.colorlegend import ColorLegend
from .gepardlogging import setDefaultLoggingConfig from .gepardlogging import setDefaultLoggingConfig
from .workmodes import ModeHandler from .workmodes import ModeHandler
from .unittests.test_gepard import testGepard from .unittests.test_gepard import testGepard
from .helperfunctions import getAppFolder
class GEPARDMainWindow(QtWidgets.QMainWindow): class GEPARDMainWindow(QtWidgets.QMainWindow):
...@@ -120,7 +121,7 @@ class GEPARDMainWindow(QtWidgets.QMainWindow): ...@@ -120,7 +121,7 @@ class GEPARDMainWindow(QtWidgets.QMainWindow):
@QtCore.pyqtSlot() @QtCore.pyqtSlot()
def testFilename(self, fileName): def testFilename(self, fileName):
if self.view.ramanctrl.name == 'RenishawCOM': # the renishawCom does not allow Spaces within filePath if self.view.instrctrl.name == 'RenishawCOM': # the renishawCom does not allow Spaces within filePath
if fileName.find(' ') == 0: if fileName.find(' ') == 0:
return False, "File path must not contain spaces." return False, "File path must not contain spaces."
else: else:
...@@ -164,8 +165,8 @@ class GEPARDMainWindow(QtWidgets.QMainWindow): ...@@ -164,8 +165,8 @@ class GEPARDMainWindow(QtWidgets.QMainWindow):
self.opticalScanAct.setChecked(osc) self.opticalScanAct.setChecked(osc)
self.detectParticleAct.setEnabled(pde) self.detectParticleAct.setEnabled(pde)
self.detectParticleAct.setChecked(pdc) self.detectParticleAct.setChecked(pdc)
self.ramanScanAct.setEnabled(rse) self.specScanAct.setEnabled(rse)
self.ramanScanAct.setChecked(rsc) self.specScanAct.setChecked(rsc)
def activateMaxMode(self, loadnew=False) -> None: def activateMaxMode(self, loadnew=False) -> None:
self.modeHandler.activateMaxMode(loadnew) self.modeHandler.activateMaxMode(loadnew)
...@@ -192,7 +193,7 @@ class GEPARDMainWindow(QtWidgets.QMainWindow): ...@@ -192,7 +193,7 @@ class GEPARDMainWindow(QtWidgets.QMainWindow):
self.exitAct.setEnabled(False) self.exitAct.setEnabled(False)
self.opticalScanAct.setEnabled(False) self.opticalScanAct.setEnabled(False)
self.detectParticleAct.setEnabled(False) self.detectParticleAct.setEnabled(False)
self.ramanScanAct.setEnabled(False) self.specScanAct.setEnabled(False)
def updateConnected(self, connected): def updateConnected(self, connected):
if connected: if connected:
...@@ -265,17 +266,17 @@ class GEPARDMainWindow(QtWidgets.QMainWindow): ...@@ -265,17 +266,17 @@ class GEPARDMainWindow(QtWidgets.QMainWindow):
self.detectParticleAct.triggered.connect( self.detectParticleAct.triggered.connect(
QtCore.pyqtSlot()(lambda: self.modeHandler.switchMode("ParticleDetection"))) QtCore.pyqtSlot()(lambda: self.modeHandler.switchMode("ParticleDetection")))
self.ramanScanAct = QtWidgets.QAction("Raman Scan", self) self.specScanAct = QtWidgets.QAction("Spectrum Scan", self)
self.ramanScanAct.setEnabled(False) self.specScanAct.setEnabled(False)
self.ramanScanAct.setCheckable(True) self.specScanAct.setCheckable(True)
self.ramanScanAct.triggered.connect(QtCore.pyqtSlot()(lambda: self.modeHandler.switchMode("SpectrumScan"))) self.specScanAct.triggered.connect(QtCore.pyqtSlot()(lambda: self.modeHandler.switchMode("SpectrumScan")))
self.snapshotAct = QtWidgets.QAction("&Save Screenshot", self) self.snapshotAct = QtWidgets.QAction("&Save Screenshot", self)
self.snapshotAct.triggered.connect(self.view.takeScreenshot) self.snapshotAct.triggered.connect(self.view.takeScreenshot)
self.snapshotAct.setDisabled(True) self.snapshotAct.setDisabled(True)
self.configRamanCtrlAct = QtWidgets.QAction("&Configure Raman Control", self) self.configRamanCtrlAct = QtWidgets.QAction("&Configure Raman Control", self)
self.configRamanCtrlAct.triggered.connect(self.view.configureRamanControl) self.configRamanCtrlAct.triggered.connect(self.view.configureInstrumentControl)
if self.view.simulatedRaman: if self.view.simulatedRaman:
self.configRamanCtrlAct.setDisabled(True) self.configRamanCtrlAct.setDisabled(True)
...@@ -365,7 +366,7 @@ class GEPARDMainWindow(QtWidgets.QMainWindow): ...@@ -365,7 +366,7 @@ class GEPARDMainWindow(QtWidgets.QMainWindow):
self.toolbar.addSeparator() self.toolbar.addSeparator()
self.toolbar.addAction(self.opticalScanAct) self.toolbar.addAction(self.opticalScanAct)
self.toolbar.addAction(self.detectParticleAct) self.toolbar.addAction(self.detectParticleAct)
self.toolbar.addAction(self.ramanScanAct) self.toolbar.addAction(self.specScanAct)
self.toolbar.addSeparator() self.toolbar.addSeparator()
self.toolbar.addAction(self.exitAct) self.toolbar.addAction(self.exitAct)
self.toolbar.setOrientation(QtCore.Qt.Vertical) self.toolbar.setOrientation(QtCore.Qt.Vertical)
...@@ -380,7 +381,7 @@ if __name__ == '__main__': ...@@ -380,7 +381,7 @@ if __name__ == '__main__':
""" """
Closes the app and, with that, all windows. Closes the app and, with that, all windows.
Josef: I implemented this, as with the simulated microscope stage it was difficult to find a proper way to Josef: I implemented this, as with the simulated microscope stage it was difficult to find a proper way to
ONLY close it at the end of running the program. Closing it on disconnect of the ramanctrl is not suitable, ONLY close it at the end of running the program. Closing it on disconnect of the instrctrl is not suitable,
as it should be opened also in disconnected stage (e.g., when another instance is running in optical or raman as it should be opened also in disconnected stage (e.g., when another instance is running in optical or raman
scan, but the UI (disconnected) should still update what's going on. scan, but the UI (disconnected) should still update what's going on.
""" """
...@@ -409,11 +410,7 @@ if __name__ == '__main__': ...@@ -409,11 +410,7 @@ if __name__ == '__main__':
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
app = QtWidgets.QApplication(sys.argv) app = QtWidgets.QApplication(sys.argv)
app.setApplicationName("GEPARD") # appname needed for logpath logpath = getAppFolder()
logpath = QtCore.QStandardPaths.writableLocation(
QtCore.QStandardPaths.AppLocalDataLocation)
fp = None
if logpath != "": if logpath != "":
if not os.path.exists(logpath): if not os.path.exists(logpath):
os.mkdir(logpath) os.mkdir(logpath)
......
This diff is collapsed.
...@@ -66,13 +66,13 @@ class Particle(object): ...@@ -66,13 +66,13 @@ class Particle(object):
def getHQIOfMeasurementIndex(self, index) -> float: def getHQIOfMeasurementIndex(self, index) -> float:
for meas in self.measurements: for meas in self.measurements:
if meas.ramanScanIndex == index: if meas.specScanIndex == index:
return meas.getHQI() return meas.getHQI()
def getMeasurementIndices(self) -> List[int]: def getMeasurementIndices(self) -> List[int]:
indices: List[int] = [] indices: List[int] = []
for meas in self.measurements: for meas in self.measurements:
indices.append(meas.ramanScanIndex) indices.append(meas.specScanIndex)
return indices return indices
def getMeasurements(self) -> List['Measurement']: def getMeasurements(self) -> List['Measurement']:
...@@ -126,7 +126,7 @@ class Particle(object): ...@@ -126,7 +126,7 @@ class Particle(object):
class Measurement(object): class Measurement(object):
def __init__(self): def __init__(self):
super(Measurement, self).__init__() super(Measurement, self).__init__()
self.ramanScanIndex: int = np.nan self.specScanIndex: int = np.nan
self.pixelcoord_x: int = np.nan self.pixelcoord_x: int = np.nan
self.pixelcoord_y: int = np.nan self.pixelcoord_y: int = np.nan
...@@ -165,4 +165,4 @@ class Measurement(object): ...@@ -165,4 +165,4 @@ class Measurement(object):
return self.assignment_orig return self.assignment_orig
def getScanIndex(self) -> int: def getScanIndex(self) -> int:
return self.ramanScanIndex return self.specScanIndex
...@@ -52,7 +52,7 @@ class ParticleContainer(object): ...@@ -52,7 +52,7 @@ class ParticleContainer(object):
particle.measurements = [] particle.measurements = []
def setMeasurementScanIndex(self, indexOfMeasurment, scanIndex): def setMeasurementScanIndex(self, indexOfMeasurment, scanIndex):
self.measurements[indexOfMeasurment].ramanScanIndex = scanIndex self.measurements[indexOfMeasurment].specScanIndex = scanIndex
def setMeasurementPixelCoords(self, indexOfMeasurment, x, y): def setMeasurementPixelCoords(self, indexOfMeasurment, x, y):
self.measurements[indexOfMeasurment].pixelcoord_x = x self.measurements[indexOfMeasurment].pixelcoord_x = x
......
...@@ -114,7 +114,6 @@ class ParticlePainter(QtWidgets.QGraphicsItem): ...@@ -114,7 +114,6 @@ class ParticlePainter(QtWidgets.QGraphicsItem):
def adjustMarginsAndPlaceImage(self, pixelPos): def adjustMarginsAndPlaceImage(self, pixelPos):
x_min, x_max = round(pixelPos.x()-self.radius), round(pixelPos.x()+self.radius) x_min, x_max = round(pixelPos.x()-self.radius), round(pixelPos.x()+self.radius)
y_min, y_max = round(pixelPos.y()-self.radius), round(pixelPos.y()+self.radius) y_min, y_max = round(pixelPos.y()-self.radius), round(pixelPos.y()+self.radius)
#TODO: Using cv2.warpAffine would probably be more elegant....
x_shift = y_shift = int(0) x_shift = y_shift = int(0)
if x_min < 0: if x_min < 0:
......
...@@ -47,7 +47,7 @@ def loadData(fname): ...@@ -47,7 +47,7 @@ def loadData(fname):
retds.__dict__.update(ds.__dict__) retds.__dict__.update(ds.__dict__)
if retds.version < currentVersion: if retds.version < currentVersion:
legacyConversion(retds) legacyConversion(retds)
elif retds.zvalimg=="saved": elif retds.zvalimg == "saved":
retds.loadZvalImg() retds.loadZvalImg()
retds.particleContainer.datasetParent = retds #TODO: This is mainly a workaround to update the ref in particleContainer. It probably should be handled differently anyways... retds.particleContainer.datasetParent = retds #TODO: This is mainly a workaround to update the ref in particleContainer. It probably should be handled differently anyways...
return retds return retds
...@@ -114,6 +114,7 @@ def recursiveDictCompare(d1, d2): ...@@ -114,6 +114,7 @@ def recursiveDictCompare(d1, d2):
return False return False
return True return True
class DataSet(object): class DataSet(object):
def __init__(self, fname, newProject=False): def __init__(self, fname, newProject=False):
self.fname = fname self.fname = fname
...@@ -141,7 +142,7 @@ class DataSet(object): ...@@ -141,7 +142,7 @@ class DataSet(object):
self.pyramidParams = None self.pyramidParams = None
# parameters specifically for raman scan # parameters specifically for raman scan
self.pshift = None # shift of raman scan position relative to image center self.pshift = None # shift of spectrometer scan position relative to image center
self.seedpoints = np.array([]) self.seedpoints = np.array([])
self.seeddeletepoints = np.array([]) self.seeddeletepoints = np.array([])
self.detectParams = {'points': np.array([[50,0],[100,200],[200,255]]), self.detectParams = {'points': np.array([[50,0],[100,200],[200,255]]),
...@@ -157,7 +158,7 @@ class DataSet(object): ...@@ -157,7 +158,7 @@ class DataSet(object):
self.particleContainer = ParticleContainer(self) self.particleContainer = ParticleContainer(self)
self.particleDetectionDone = False self.particleDetectionDone = False
self.ramanscandone = False self.specscandone = False
self.resultParams = {'minHQI': 5} self.resultParams = {'minHQI': 5}
self.colorSeed = 'default' self.colorSeed = 'default'
...@@ -232,16 +233,6 @@ class DataSet(object): ...@@ -232,16 +233,6 @@ class DataSet(object):
p0[0] -= self.signx*self.imagedim_df[0]/2 p0[0] -= self.signx*self.imagedim_df[0]/2
p0[1] -= self.signy*self.imagedim_df[1]/2 p0[1] -= self.signy*self.imagedim_df[1]/2
x, y = self.signx*(p[0] - p0[0])/pixelscale, self.signy*(p[1] - p0[1])/pixelscale x, y = self.signx*(p[0] - p0[0])/pixelscale, self.signy*(p[1] - p0[1])/pixelscale
# TODO: SANITY CHECK AT REAL INSTRUMENT IF THE BELOW CODE CAN BE REMOVED (WAS SUBSTITUTED BY THE 4 LINES ABOVE)
# if mode == 'df':
# p0[0] -= self.signx*self.imagedim_df[0]/2
# p0[1] -= self.signy*self.imagedim_df[1]/2
# x, y = self.signx*(p[0] - p0[0])/self.pixelscale_df, self.signy*(p[1] - p0[1])/self.pixelscale_df
#
# elif mode == 'bf':
# p0[0] -= self.signx*self.imagedim_bf[0]/2
# p0[1] -= self.signy*self.imagedim_bf[1]/2
# x, y = self.signx*(p[0] - p0[0])/self.pixelscale_bf, self.signy*(p[1] - p0[1])/self.pixelscale_bf
return x, y return x, y
def mapToLength(self, pixelpos, mode='df', force=False, returnz=False): def mapToLength(self, pixelpos, mode='df', force=False, returnz=False):
...@@ -272,7 +263,7 @@ class DataSet(object): ...@@ -272,7 +263,7 @@ class DataSet(object):
return x, y, z return x, y, z
return x, y return x, y
def mapToLengthRaman(self, pixelpos, microscopeMode='df', noz=False): def mapToLengthSpectrometer(self, pixelpos, microscopeMode='df', noz=False):
p0x, p0y, z = self.mapToLength(pixelpos, mode=microscopeMode, returnz=True) p0x, p0y, z = self.mapToLength(pixelpos, mode=microscopeMode, returnz=True)
x, y = p0x + self.pshift[0], p0y + self.pshift[1] x, y = p0x + self.pshift[0], p0y + self.pshift[1]
return x, y, z return x, y, z
......
...@@ -16,7 +16,7 @@ magnification = 20 ...@@ -16,7 +16,7 @@ magnification = 20
#information specific for renishaw control #information specific for renishaw control
#image mikrometer sizes for bright and dark field camera, format: width*height #image mikrometer sizes for bright and dark field camera, format: width*height
#please insert, as it would represent an image at 1x magnification #please insert, as it would represent an image at 1x magnification
#if unavailable, export an image from the Renishaw Camera viewer. Export as jpeg (without axes) and, within Gepard, go to Tools->ConfigureRamanControl. #if unavailable, export an image from the Renishaw Camera viewer. Export as jpeg (without axes) and, within Gepard, go to Tools->ConfigureInstrumentControl.
img_size_BF = 9016.0*5748.0 img_size_BF = 9016.0*5748.0
img_size_DF = 4524.0*2874.0 img_size_DF = 4524.0*2874.0
#Path to measuring templates (*.wxm) #Path to measuring templates (*.wxm)
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" """
Created on Fri Sep 21 12:23:20 2018 GEPARD - Gepard-Enabled PARticle Detection
Copyright (C) 2018 Lars Bittrich and Josef Brandt, Leibniz-Institut für
Polymerforschung Dresden e. V. <bittrich-lars@ipfdd.de>
@author: brandt This program is free software: you can redistribute it and/or modify
""" it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program, see COPYING.
If not, see <https://www.gnu.org/licenses/>.
"""
from PyQt5 import QtWidgets from PyQt5 import QtWidgets
class RamanConfigWin(QtWidgets.QWidget):
class InstrumentConfigWin(QtWidgets.QWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
super(RamanConfigWin, self).__init__() super(InstrumentConfigWin, self).__init__()
self.parent = parent self.parent = parent
if parent is not None: if parent is not None:
self.ramancontrol = self.parent.ramanctrl self.instrcontrol = self.parent.instrctrl
self.setGeometry(200, 200, 400, 300) self.setGeometry(200, 200, 400, 300)
self.setWindowTitle('Configure Raman Control') self.setWindowTitle('Configure Raman Control')
...@@ -28,7 +39,7 @@ class RamanConfigWin(QtWidgets.QWidget): ...@@ -28,7 +39,7 @@ class RamanConfigWin(QtWidgets.QWidget):
generalLayout = QtWidgets.QFormLayout() generalLayout = QtWidgets.QFormLayout()
self.magnSpinBox = QtWidgets.QSpinBox() self.magnSpinBox = QtWidgets.QSpinBox()
if parent is not None: if parent is not None:
self.magnSpinBox.setValue(self.ramancontrol.magn) self.magnSpinBox.setValue(self.instrcontrol.magn)
else: else:
self.magnSpinBox.setValue(20) self.magnSpinBox.setValue(20)
generalLayout.addRow(QtWidgets.QLabel('Magnification (x)'), self.magnSpinBox) generalLayout.addRow(QtWidgets.QLabel('Magnification (x)'), self.magnSpinBox)
...@@ -48,10 +59,10 @@ class RamanConfigWin(QtWidgets.QWidget): ...@@ -48,10 +59,10 @@ class RamanConfigWin(QtWidgets.QWidget):
spinbox.setMaximum(1e7) spinbox.setMaximum(1e7)
if self.parent is not None: if self.parent is not None:
self.ren_BFwidth.setValue(self.ramancontrol.cam_bf_dims[0]) self.ren_BFwidth.setValue(self.instrcontrol.cam_bf_dims[0])
self.ren_BFheight.setValue(self.ramancontrol.cam_bf_dims[1]) self.ren_BFheight.setValue(self.instrcontrol.cam_bf_dims[1])
self.ren_DFwidth.setValue(self.ramancontrol.cam_df_dims[0]) self.ren_DFwidth.setValue(self.instrcontrol.cam_df_dims[0])
self.ren_DFheight.setValue(self.ramancontrol.cam_df_dims[1]) self.ren_DFheight.setValue(self.instrcontrol.cam_df_dims[1])
self.getBFImgDimBtn = QtWidgets.QPushButton('Read dimensions from File') self.getBFImgDimBtn = QtWidgets.QPushButton('Read dimensions from File')
self.getBFImgDimBtn.released.connect(self.makeReadImgDimsLambda(self.ren_BFwidth, self.ren_BFheight)) self.getBFImgDimBtn.released.connect(self.makeReadImgDimsLambda(self.ren_BFwidth, self.ren_BFheight))
...@@ -126,51 +137,13 @@ class RamanConfigWin(QtWidgets.QWidget): ...@@ -126,51 +137,13 @@ class RamanConfigWin(QtWidgets.QWidget):
QtWidgets.QMessageBox.critical(self, 'Error', 'Reading dimensions from jpeg failed') QtWidgets.QMessageBox.critical(self, 'Error', 'Reading dimensions from jpeg failed')
def closeEvent(self, event): def closeEvent(self, event):
ret = QtWidgets.QMessageBox.question(self, '', 'Save Data to RamanControl?', QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.Yes) ret = QtWidgets.QMessageBox.question(self, '', 'Save Data to InstrumentControl?', QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.Yes)
if ret == QtWidgets.QMessageBox.Yes: if ret == QtWidgets.QMessageBox.Yes:
if self.parent is not None: if self.parent is not None:
if self.ramancontrol.hostname == 'AN-Raman-Renishaw': if self.instrcontrol.hostname == 'AN-Raman-Renishaw':
self.ramancontrol.cam_bf_dims = [self.ren_BFwidth.value(), self.ren_BFheight.value()] self.instrcontrol.cam_bf_dims = [self.ren_BFwidth.value(), self.ren_BFheight.value()]
self.ramancontrol.cam_df_dims = [self.ren_DFwidth.value(), self.ren_DFheight.value()] self.instrcontrol.cam_df_dims = [self.ren_DFwidth.value(), self.ren_DFheight.value()]
self.ramancontrol.magn = self.magnSpinBox.value() self.instrcontrol.magn = self.magnSpinBox.value()
else: else:
print('fake saved') print('fake saved')
class RamanSettingParam(object):
def __init__(self, name, dtype, default=None, minVal=None, maxVal=None, valList=None, openFileType=None):
self.name = name
self.dtype = dtype
self.value = default
self.minVal = minVal
self.maxVal = maxVal
self.valList = valList
self.openFileType = openFileType
if not self.hasValidType():
print('erroreneous type in setting parameter:', self.dtype)
def hasValidType(self):
if self.dtype in ['int', 'double', 'checkBox', 'combobox', 'selectBtn']:
return True
else:
return False
def value_of(self, obj):
if self.dtype in ['int', 'double']:
return obj.value()
elif self.dtype == 'checkBox':
return obj.isChecked()
elif self.dtype == 'combobox':
return obj.currentText()
elif self.dtype == 'selectBtn':
return obj.text()
if __name__ == '__main__':
import sys
app = QtWidgets.QApplication(sys.argv)
setWin = RamanConfigWin()
setWin.show()
ret = app.exec_()
\ No newline at end of file
...@@ -3,7 +3,7 @@ import numpy as np ...@@ -3,7 +3,7 @@ import numpy as np
from typing import List from typing import List
from copy import deepcopy from copy import deepcopy
from ..coordinatetransform import ImageMarker, TrayMarker, getTransform from ..coordinatetransform import ImageMarker, TrayMarker, getTransform
from ..ramancom.ramanbase import RamanBase from ..instrumentcom.instrumentComBase import InstrumentComBase
class CoordTransformUI(QtWidgets.QWidget): class CoordTransformUI(QtWidgets.QWidget):
...@@ -12,7 +12,7 @@ class CoordTransformUI(QtWidgets.QWidget): ...@@ -12,7 +12,7 @@ class CoordTransformUI(QtWidgets.QWidget):
self.setWindowTitle('Recalculate Coordinate System') self.setWindowTitle('Recalculate Coordinate System')
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
self.viewParent = viewParent self.viewParent = viewParent
self.ramanctrl: RamanBase = self.viewParent.ramanctrl self.instrctrl: InstrumentComBase = self.viewParent.instrctrl
self.imageMarkers: List[ImageMarker] = [] # in the new coord system self.imageMarkers: List[ImageMarker] = [] # in the new coord system
self.newImageMarkers: List[ImageMarker] = [] self.newImageMarkers: List[ImageMarker] = []
...@@ -185,7 +185,7 @@ class CoordTransformUI(QtWidgets.QWidget): ...@@ -185,7 +185,7 @@ class CoordTransformUI(QtWidgets.QWidget):
def _addNewImageMarker(self, pos: tuple) -> None: def _addNewImageMarker(self, pos: tuple) -> None:
newImageMarker: ImageMarker = ImageMarker() newImageMarker: ImageMarker = ImageMarker()
newImageMarker.index = len(self.imageMarkers) newImageMarker.index = len(self.imageMarkers)
x, y, z = self.ramanctrl.getPosition() x, y, z = self.instrctrl.getPosition()
newImageMarker.worldCoordX = x newImageMarker.worldCoordX = x
newImageMarker.worldCoordY = y newImageMarker.worldCoordY = y
newImageMarker.worldCoordZ = z newImageMarker.worldCoordZ = z
...@@ -205,7 +205,7 @@ class CoordTransformUI(QtWidgets.QWidget): ...@@ -205,7 +205,7 @@ class CoordTransformUI(QtWidgets.QWidget):
def _readNewImageMarker(self, index: int) -> None: def _readNewImageMarker(self, index: int) -> None:
"""Reads current instrument coordinates and assignes them to the respective "new image marker" """ """Reads current instrument coordinates and assignes them to the respective "new image marker" """
x, y, z = self.ramanctrl.getPosition() x, y, z = self.instrctrl.getPosition()
self.newImageMarkers[index].worldCoordX = x self.newImageMarkers[index].worldCoordX = x
self.newImageMarkers[index].worldCoordY = y self.newImageMarkers[index].worldCoordY = y
self.newImageMarkers[index].worldCoordZ = z self.newImageMarkers[index].worldCoordZ = z
......
...@@ -705,7 +705,7 @@ class ParticleDetectionView(QtWidgets.QWidget): ...@@ -705,7 +705,7 @@ class ParticleDetectionView(QtWidgets.QWidget):
self.dataset.particleContainer.clearParticles() self.dataset.particleContainer.clearParticles()
self.dataset.particleContainer.clearMeasurements() self.dataset.particleContainer.clearMeasurements()
self.dataset.particleDetectionDone = False self.dataset.particleDetectionDone = False
self.dataset.ramanscandone = False self.dataset.specscandone = False
self.dataset.mode = "opticalscan" self.dataset.mode = "opticalscan"
self.dataset.save() self.dataset.save()
self.imageUpdate.emit(self.view.microscopeMode) self.imageUpdate.emit(self.view.microscopeMode)
...@@ -829,7 +829,7 @@ class ParticleDetectionView(QtWidgets.QWidget): ...@@ -829,7 +829,7 @@ class ParticleDetectionView(QtWidgets.QWidget):
self.detectThreadRunning = False self.detectThreadRunning = False
def applyResultsToDataset(self, measurementPoints, contours):