input for pixelsize
@@ -29,6 +29,7 @@ from PyQt4 import QtCore, QtGui
from .. import io, lib, render
from numpy.lib.recfunctions import stack_arrays
+from numpy.lib.recfunctions import append_fields
from cmath import rect, phase
from math import radians, degrees
@@ -604,7 +605,27 @@ class Window(QtGui.QMainWindow):
locs, info = io.load_locs(path, qt_parent=self)
except io.NoMetadataFileError:
return
+
+ if not hasattr(locs,'group'):
+ msgBox = QtGui.QMessageBox(self)
+ msgBox.setWindowTitle('Error')
+ msgBox.setText('Datafile does not contain group information. Please load a file with picked localizations.')
+ msgBox.exec_()
+
+ else:
locs = lib.ensure_sanity(locs, info)
+ self.pixelsize = 0
+ if not hasattr(locs, 'z'):
+ locs = lib.append_to_rec(locs, locs.x.copy(), 'z')
+ self.pixelsize = 1
+ else:
+ if self.pixelsize == 0:
+ pixelsize,ok = QtGui.QInputDialog.getInt(self,"Pixelsize Dialog","Please enter the pixelsize in nm",130)
+ if ok:
+ self.pixelsize = pixelsize
+ else:
+ self.pixelsize = 130
+
self.locs.append(locs)
self.infos.append(info)
self.locs_paths.append(path)
@@ -640,7 +661,6 @@ class Window(QtGui.QMainWindow):
self.z_min = np.min([np.min(locs.z),self.z_min])
self.z_max = np.min([np.max(locs.z),self.z_max])
- self.pixelsize = 160
N_avg, image_avg3 = render.render_hist3d(self.locs[0], self.oversampling, self.t_min, self.t_min, self.t_max, self.t_max, self.z_min, self.z_max, self.pixelsize)
@@ -730,10 +750,6 @@ class Window(QtGui.QMainWindow):
self.locs[j].y -= mean_y
self.locs[j].z -= mean_z
-
-
-
-
def centerofmass(self):
print('Aligning by center of mass')
n_groups = self.n_groups
