added mode for mask image that allows to save the localizations outside of the mask
@@ -1181,6 +1181,7 @@ class MaskSettingsDialog(QtGui.QDialog):
index = self.mask[y_ind,x_ind].astype(bool)
self.index_locs = locs[index]
+ self.index_locs_out = locs[~index]
H_new, xedges, yedges = np.histogram2d(self.index_locs['x'], self.index_locs['y'], bins=(self.xedges, self.yedges))
self.H_new = H_new.T # Let each row list bins with common y range.
@@ -1195,11 +1196,17 @@ class MaskSettingsDialog(QtGui.QDialog):
def save_locs(self):
channel = 0
base, ext = os.path.splitext(self.paths[channel])
- out_path = base + '_render.hdf5'
- path = QtGui.QFileDialog.getSaveFileName(self, 'Save localizations', out_path, filter='*.hdf5')
+ 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'}]
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'}]
+ io.save_locs(path, self.index_locs_out, info)
+
class ToolsSettingsDialog(QtGui.QDialog):
