changed max iterations for align to 4 and included a progress bar, added output to yaml file for mask tool in render
@@ -1207,12 +1207,16 @@ class MaskSettingsDialog(QtGui.QDialog):
out_path = base + '_mask_in.hdf5'
path = QtGui.QFileDialog.getSaveFileName(self, 'Save localizations within mask', out_path, filter='*.hdf5')
if path:
- info = self.infos[channel] + [{'Generated by': 'Picasso Render'}]
+ info = self.infos[channel] + [{'Generated by': 'Picasso Render : Mask in '}]
+ clusterfilter_info = {'Oversampling':self.oversampling, 'Blur': self.blur, 'Threshold': self.tresh}
+ info.append(clusterfilter_info)
io.save_locs(path, self.index_locs, info)
out_path = base + '_mask_out.hdf5'
path = QtGui.QFileDialog.getSaveFileName(self, 'Save localizations outside of mask', out_path, filter='*.hdf5')
if path:
- info = self.infos[channel] + [{'Generated by': 'Picasso Render'}]
+ info = self.infos[channel] + [{'Generated by': 'Picasso Render : Mask out'}]
+ clusterfilter_info = {'Oversampling':self.oversampling, 'Blur': self.blur, 'Threshold': self.tresh}
+ info.append(clusterfilter_info)
io.save_locs(path, self.index_locs_out, info)
@@ -1712,8 +1716,7 @@ class View(QtGui.QLabel):
sp.set_value(i+1)
self.update_scene()
else:
- completed = False
- max_iterations = 10
+ max_iterations = 4
iteration = 0
convergence = 0.001 # Thhat is 0.001 pixels ~0.13nm
shift_x = []
@@ -1721,11 +1724,13 @@ class View(QtGui.QLabel):
shift_z = []
display = True
- if iteration == max_iterations:
- completed = True
+ progress = lib.ProgressDialog('Aligning images..', 0, max_iterations, self)
+ progress.show()
+ progress.set_value(0)
- while not completed:
- completed = True
+ for iteration in range(max_iterations):
+ completed = 'True'
+ progress.set_value(iteration)
shift = self.shift_from_rcc()
sp = lib.ProgressDialog('Shifting channels', 0, len(self.locs), self)
sp.set_value(0)
@@ -1751,6 +1756,12 @@ class View(QtGui.QLabel):
shift_z.append(np.mean(temp_shift_z))
iteration+=1
self.update_scene()
+
+ #Skip when converged:
+ if completed:
+ break
+
+ progress.close()
#Plot shift etc
if display:
fig1 = plt.figure(figsize=(8, 8))
