Commit a6aa8137 authored by Josef Brandt's avatar Josef Brandt

Debug Cleanup

parent 8e1d8a77
......@@ -66,18 +66,17 @@ def loadData(fname):
def saveData(dataset, fname):
pass
# with open(fname, "wb") as fp:
# # zvalimg is rather large and thus it is saved separately in a tif file
# # only onces after its creation
# zvalimg = dataset.zvalimg
# if zvalimg is not None:
# dataset.zvalimg = "saved"
#
# dataset.beforeSave()
# pickle.dump(dataset, fp, protocol=-1)
# dataset.zvalimg = zvalimg
# dataset.afterSave()
with open(fname, "wb") as fp:
# zvalimg is rather large and thus it is saved separately in a tif file
# only onces after its creation
zvalimg = dataset.zvalimg
if zvalimg is not None:
dataset.zvalimg = "saved"
dataset.beforeSave()
pickle.dump(dataset, fp, protocol=-1)
dataset.zvalimg = zvalimg
dataset.afterSave()
def arrayCompare(a1, a2):
......@@ -358,12 +357,9 @@ class DataSet(object):
if (returnz and self.zvalimg is not None) or self.coordinatetransform is not None:
z = self.mapHeight(x, y, force)
z += self.getZval(pixelpos)
print(f'mapToLength of {pixelpos} before coordTrans: {(x, y, z)}')
if self.coordinatetransform is not None:
x, y, z = tuple(self.coordinatetransform.applyTransform(np.array([x, y, z])))
print('mapping to length:', pixelpos, (x, y, z))
if returnz:
return x, y, z
return x, y
......
......@@ -79,19 +79,6 @@ class CoordTransformUI(QtWidgets.QWidget):
newImgMarker.imgCoordX = imgMarker.imgCoordX
newImgMarker.imgCoordY = imgMarker.imgCoordY
if newImgMarker.index == 0:
newImgMarker.worldCoordX = -6136
newImgMarker.worldCoordY = 3344
newImgMarker.worldCoordZ = 20606
elif newImgMarker.index == 1:
newImgMarker.worldCoordX = 3447
newImgMarker.worldCoordY = -4756
newImgMarker.worldCoordZ = 20606
elif newImgMarker.index == 2:
newImgMarker.worldCoordX = -6456
newImgMarker.worldCoordY = -2490
newImgMarker.worldCoordZ = 20602
self._imgMarkersDst.append(newImgMarker)
self._trayMarkersSrc = deepcopy(self._dataset.trayMarkers)
......
......@@ -36,7 +36,7 @@ def calculateZValImageFromParticles(dataset: 'DataSet', updateSignal: 'QtCore.py
contour in the zval image.
"""
particles: List['Particle'] = dataset.particleContainer.getAllParticles()
zpos: np.ndarray = getZPositionsFromParticles(particles)
zpos: np.ndarray = getZPositionsFromParticles(particles) * -1
dataset.zpositions = zpos
numZPos = len(zpos)
for i, particle in enumerate(particles):
......
......@@ -372,19 +372,10 @@ class SampleView(QtWidgets.QGraphicsView):
noz = self.imparent.getCurrentModeType() == MeasureModes.OPTICAL_SCAN
x, y, z = self.dataset.mapToLengthSpectrometer([pos.x(), pos.y()], self.microscopeMode, noz)
curPos = self.instrctrl.getPosition()
curX, curY, curZ = round(curPos[0]), round(curPos[1]), round(curPos[2])
newX, newY = round(x), round(y)
newZ = curZ if z is None else round(z)
reply = QtWidgets.QMessageBox.question(self, "Moving",
f"Moving from {curX, curY, curZ} to {newX, newY, newZ}. Proceed?",
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
QtWidgets.QMessageBox.No)
if reply == QtWidgets.QMessageBox.Yes:
if z is not None:
assert z > -100.
self.instrctrl.moveToAbsolutePosition(x, y, z)
if z is not None:
assert z > -100.
self.instrctrl.moveToAbsolutePosition(x, y, z)
def hideSpectraMarkers(self) -> None:
if self.imparent.hideLabelAct.isChecked():
......
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