loading channels bug fix
@@ -5161,7 +5161,7 @@ class View(QtWidgets.QLabel):
self.x_render_state = False
self.z_converted = []
- def get_group_color(self, locs, progress_dialog=None):
+ def get_group_color(self, locs):
"""
Finds group color for each localization in single channel data
with group info.
@@ -5170,8 +5170,6 @@ class View(QtWidgets.QLabel):
----------
locs : np.recarray
Array with all localizations
- progress_dialog : QtWidgets.QProgressDialog
- Progress dialog instance
Returns
-------
@@ -5185,8 +5183,6 @@ class View(QtWidgets.QLabel):
# check if groups are consecutive
if set(groups) == set(range(min(groups), max(groups) + 1)):
if len(groups) > 5000:
- if progress_dialog is not None:
- progress_dialog.setModal(False)
choice = QtWidgets.QMessageBox.question(
self,
"Group question",
@@ -5197,8 +5193,6 @@ class View(QtWidgets.QLabel):
),
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
)
- if progress_dialog is not None:
- progress_dialog.setModal(True)
if choice == QtWidgets.QMessageBox.Yes:
pb = lib.ProgressDialog(
"Re-Indexing groups", 0, len(groups), self
@@ -5218,7 +5212,7 @@ class View(QtWidgets.QLabel):
groups %= N_GROUP_COLORS
return groups[groupcopy]
- def add(self, path, render=True, progress_dialog=None):
+ def add(self, path, render=True):
"""
Loads a .hdf5 localizations and the associated .yaml metadata
files.
@@ -5230,8 +5224,6 @@ class View(QtWidgets.QLabel):
render : boolean, optional
Specifies if the loaded files should be rendered
(default True)
- progress_dialog : QtWidgets.QProgressDialog
- Progress dialog instance
"""
# read .hdf5 and .yaml files
@@ -5246,7 +5238,7 @@ class View(QtWidgets.QLabel):
# adjust that
self.z_converted.append(False)
if hasattr(locs, "z"):
- if locs.z.max() - locs.z.min() > 50: # probably z in nm
+ if locs.z.max() - locs.z.min() > 35: # probably z in nm
print("Automatically converted z coordinates to px")
pixelsize = self.window.display_settings_dlg.pixelsize.value()
locs.z /= pixelsize
@@ -5307,9 +5299,7 @@ class View(QtWidgets.QLabel):
)
if hasattr(locs, "group"):
if len(self.group_color) == 0:
- self.group_color = self.get_group_color(
- self.locs[0], progress_dialog=progress_dialog
- )
+ self.group_color = self.get_group_color(self.locs[0])
# render the loaded file
if render:
@@ -5358,9 +5348,10 @@ class View(QtWidgets.QLabel):
pd = lib.ProgressDialog(
"Loading channels", 0, len(paths), self
)
+ pd.setModal(False)
pd.set_value(0)
for i, path in enumerate(paths):
- self.add(path, render=False, progress_dialog=pd)
+ self.add(path, render=False)
pd.set_value(i+1)
if len(self.locs): # if loading was successful
if fit_in_view:
