Skip to content

Commit c421f1b

Browse files
Merge pull request #399 from jungmannlab/development
BUG FIXES 0.6.5
2 parents 4119ee5 + 3cfad00 commit c421f1b

File tree

14 files changed

+65
-44
lines changed

14 files changed

+65
-44
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.6.4
2+
current_version = 0.6.5
33
commit = True
44
tag = False
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?

changelog.rst

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
Changelog
22
=========
33

4-
Last change: 26-SEP-2023 MTS
4+
Last change: 22-OCT-2023 MTS
55

6-
0.6.4
7-
-----
8-
- Fix RCC error for Render GUI (one click installer) (remove tqdm from GUI)
9-
10-
0.6.3
11-
-----
6+
0.6.3 - 0.6.5
7+
-------------
128
- Dependencies updated
13-
- Bug fixes due to Python 3.10 and PyQt5
9+
- Bug fixes due to Python 3.10 and PyQt5 (listed below)
10+
- Fix RCC error for Render GUI (one click installer) (remove tqdm from GUI)
11+
- Fix save pick properties bug in Picasso Render GUI (one click installer)
12+
- Fix render render properties bug in Picasso Render GUI (one click installer)
13+
- Fix animation building in Picasso Render GUI (one click installer)
14+
- Fix test clusterer HDBSCAN bug
15+
- Fix .nd2 localized files info loading (full loader changed to unsafe loader)
16+
- Fix rare bug with pick similar zero division error
1417

1518
0.6.2
1619
-----
@@ -55,16 +58,16 @@ Last change: 26-SEP-2023 MTS
5558
- Updated 3D rendering and clustering documentation
5659
- Bug fixes
5760

58-
0.5.5 - 0.5.6
59-
-------------
61+
0.5.5-6
62+
-------
6063
- Cluster info is saved in ``_cluster_centers.hdf5`` files which are created when ``Save cluster centers`` box is ticked
6164
- Cluster centers contain info about group, mean frame (saved as ``frame``), standard deviation frame, area/volume and convex hull
6265
- ``gist_rainbow`` is used for rendering properties
6366
- NeNA can be calculated many times
6467
- Bug fixes
6568

66-
0.5.1 - 0.5.4
67-
-------------
69+
0.5.1-4
70+
-------
6871
- Sensitivity is a float number in Server: Watcher
6972
- One-click-installer available
7073
- Bug fixes

distribution/picasso.iss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
AppName=Picasso
33
AppPublisher=Jungmann Lab, Max Planck Institute of Biochemistry
44

5-
AppVersion=0.6.4
5+
AppVersion=0.6.5
66
DefaultDirName={commonpf}\Picasso
77
DefaultGroupName=Picasso
8-
OutputBaseFilename="Picasso-Windows-64bit-0.6.4"
8+
OutputBaseFilename="Picasso-Windows-64bit-0.6.5"
99
ArchitecturesAllowed=x64
1010
ArchitecturesInstallIn64BitMode=x64
1111

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ""
2828
# The full version, including alpha/beta/rc tags
29-
release = "0.6.4"
29+
release = "0.6.5"
3030

3131
# -- General configuration ---------------------------------------------------
3232

picasso/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import os.path as _ospath
99
import yaml as _yaml
1010

11-
__version__ = "0.6.4"
11+
__version__ = "0.6.5"
1212

1313
_this_file = _ospath.abspath(__file__)
1414
_this_dir = _ospath.dirname(_this_file)

picasso/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION_NO = "0.6.4"
1+
VERSION_NO = "0.6.5"

picasso/clusterer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def _hdbscan(X, min_cluster_size, min_samples, cluster_eps=0):
449449

450450

451451
def hdbscan(
452-
locs, min_cluster_size, min_samples, cluster_eps=0.0, pixelsize=None
452+
locs, min_cluster_size, min_samples, pixelsize=None, cluster_eps=0.0
453453
):
454454
"""
455455
Performs HDBSCAN on localizations.
@@ -463,7 +463,7 @@ def hdbscan(
463463
min_samples : int
464464
Number of localizations within radius to consider a given point
465465
a core sample
466-
pixelsize : int
466+
pixelsize : int (default=None)
467467
Camera pixel size in nm
468468
cluster_eps : float (default=0.)
469469
Distance threshold. Clusters below this value will be merged
@@ -478,7 +478,7 @@ def hdbscan(
478478
if hasattr(locs, "z"):
479479
if pixelsize is None:
480480
raise ValueError(
481-
"Camera pixel size must be specified as an integer for 3D"
481+
"Camera pixel size (nm) must be specified as an integer for 3D"
482482
" clustering."
483483
)
484484
X = _np.vstack((locs.x, locs.y, locs.z / pixelsize)).T

picasso/gui/render.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
from sklearn.metrics.pairwise import euclidean_distances
3535
from sklearn.cluster import KMeans
3636
from collections import Counter
37-
from tqdm import tqdm
3837

3938
import colorsys
4039

@@ -2307,7 +2306,7 @@ def cluster(self, locs, params):
23072306
params["min_cluster_size"],
23082307
params["min_samples"],
23092308
pixelsize,
2310-
params["intercluster_radius"]
2309+
params["intercluster_radius"],
23112310
)
23122311
elif clusterer_name == "SMLM":
23132312
if params["frame_analysis"]:
@@ -2387,7 +2386,10 @@ def test_clusterer(self):
23872386

23882387
# make sure one pick is present
23892388
if len(self.window.view._picks) != 1:
2390-
raise ValueError("Choose only one pick region")
2389+
# display qt warning
2390+
message = "Choose only one pick region"
2391+
QtWidgets.QMessageBox.information(self, "No pick", message)
2392+
return
23912393
# get clustering parameters
23922394
params = self.get_cluster_params()
23932395
# extract picked locs
@@ -5116,7 +5118,7 @@ def export_stack(self):
51165118
progress.show()
51175119

51185120
# save each channel one by one
5119-
for i in tqdm(range(self.sl.maximum() + 1)):
5121+
for i in range(self.sl.maximum() + 1):
51205122
self.sl.setValue(i)
51215123
out_path = (
51225124
base
@@ -5154,7 +5156,7 @@ def export_stack(self):
51545156
progress.set_value(0)
51555157
progress.show()
51565158

5157-
for i in tqdm(range(self.sl.maximum() + 1)):
5159+
for i in range(self.sl.maximum() + 1):
51585160
self.sl.setValue(i)
51595161
out_path = (
51605162
base
@@ -8284,7 +8286,9 @@ def analyze_cluster(self):
82848286
progress = lib.ProgressDialog(
82858287
"Calculating pick properties", 0, n_groups, self
82868288
)
8287-
pick_props = postprocess.groupprops(out_locs)
8289+
pick_props = postprocess.groupprops(
8290+
out_locs, callback=progress.set_value
8291+
)
82888292
n_units = self.window.info_dialog.calculate_n_units(dark)
82898293
pick_props = lib.append_to_rec(pick_props, n_units, "n_units")
82908294
influx = self.window.info_dialog.influx_rate.value()
@@ -8452,6 +8456,7 @@ def pick_similar(self):
84528456
NotImplementedError
84538457
If pick shape is rectangle
84548458
"""
8459+
84558460
if self._pick_shape == "Rectangle":
84568461
raise NotImplementedError(
84578462
"Pick similar not implemented for rectangle picks"
@@ -8481,7 +8486,7 @@ def pick_similar(self):
84818486
mean_rmsd = np.mean(rmsd)
84828487
std_n_locs = np.std(n_locs)
84838488
std_rmsd = np.std(rmsd)
8484-
min_n_locs = mean_n_locs - std_range * std_n_locs
8489+
min_n_locs = max(2, mean_n_locs - std_range * std_n_locs)
84858490
max_n_locs = mean_n_locs + std_range * std_n_locs
84868491
min_rmsd = mean_rmsd - std_range * std_rmsd
84878492
max_rmsd = mean_rmsd + std_range * std_rmsd
@@ -9140,9 +9145,14 @@ def save_pick_properties(self, path, channel):
91409145
progress.set_value(i + 1)
91419146
out_locs = stack_arrays(out_locs, asrecarray=True, usemask=False)
91429147
n_groups = len(picked_locs)
9143-
progress = lib.StatusDialog("Calculating pick properties", self)
9148+
progress = lib.ProgressDialog(
9149+
"Calculating pick properties", 0, n_groups, self
9150+
)
9151+
progress.show()
91449152
# get mean and std of each dtype (x, y, photons, etc)
9145-
pick_props = postprocess.groupprops(out_locs)
9153+
pick_props = postprocess.groupprops(
9154+
out_locs, callback=progress.set_value
9155+
)
91469156
progress.close()
91479157
# QPAINT estimate of number of binding sites
91489158
n_units = self.window.info_dialog.calculate_n_units(dark)
@@ -9308,7 +9318,7 @@ def activate_render_property(self):
93089318
)
93099319
pb.set_value(0)
93109320
# assign locs by color
9311-
for i in tqdm(range(colors + 1)):
9321+
for i in range(colors + 1):
93129322
x_locs.append(self.locs[0][self.x_color == i])
93139323
pb.set_value(i + 1)
93149324
pb.close()
@@ -10746,7 +10756,9 @@ def initUI(self, plugins_loaded):
1074610756
)
1074710757
plotpick3d_iso_action.triggered.connect(self.view.show_pick_3d_iso)
1074810758

10749-
filter_picks_action = tools_menu.addAction("Filter picks by locs")
10759+
filter_picks_action = tools_menu.addAction(
10760+
"Filter picks by number of locs"
10761+
)
1075010762
filter_picks_action.triggered.connect(self.view.filter_picks)
1075110763

1075210764
pickadd_action = tools_menu.addAction("Subtract pick regions")
@@ -11881,7 +11893,7 @@ def save_pick_properties(self):
1188111893
"_pickprops",
1188211894
)
1188311895
if ok:
11884-
for channel in tqdm(range(len(self.view.locs_paths))):
11896+
for channel in range(len(self.view.locs_paths)):
1188511897
base, ext = os.path.splitext(
1188611898
self.view.locs_paths[channel]
1188711899
)

picasso/gui/rotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ def build_animation(self):
713713
] # paths to each frame
714714
image_files.sort(key=natural_keys) # sort frames
715715
video = ImageSequenceClip(image_files, fps=self.fps.value())
716-
video.write_videofile(name)
716+
video.write_videofile(name, logger=None)
717717

718718
# delete animation frames
719719
for file in os.listdir(path):

picasso/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def load_info(path, qt_parent=None):
198198
filename = path_base + ".yaml"
199199
try:
200200
with open(filename, "r") as info_file:
201-
info = list(_yaml.load_all(info_file, Loader=_yaml.FullLoader))
201+
info = list(_yaml.load_all(info_file, Loader=_yaml.UnsafeLoader))
202202
except FileNotFoundError as e:
203203
print("\nAn error occured. Could not find metadata file:\n{}".format(filename))
204204
if qt_parent is not None:

picasso/postprocess.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,11 @@ def pick_similar(
165165
picked_locs_xy = _locs_at(
166166
x_test, y_test, block_locs_xy, r
167167
)
168-
x_test = _np.mean(picked_locs_xy[0])
169-
y_test = _np.mean(picked_locs_xy[1])
168+
if picked_locs_xy.shape[1] > 1:
169+
x_test = _np.mean(picked_locs_xy[0])
170+
y_test = _np.mean(picked_locs_xy[1])
171+
else:
172+
break
170173
if _np.all(
171174
(x_similar - x_test) ** 2
172175
+ (y_similar - y_test) ** 2
@@ -1167,9 +1170,12 @@ def groupprops(locs, callback=None):
11671170
groups = _np.recarray(n, formats=formats, names=names)
11681171
if callback is not None:
11691172
callback(0)
1170-
for i, group_id in enumerate(
1171-
_tqdm(group_ids, desc="Calculating group statistics", unit="Groups")
1172-
):
1173+
it = enumerate(group_ids)
1174+
else:
1175+
it = enumerate(_tqdm(
1176+
group_ids, desc="Calculating group statistics", unit="Groups"
1177+
))
1178+
for i, group_id in it:
11731179
group_locs = locs[locs.group == group_id]
11741180
groups["group"][i] = group_id
11751181
groups["n_events"][i] = len(group_locs)

release/one_click_windows_gui/create_installer_windows.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ call conda activate picasso_installer
1111
call python setup.py sdist bdist_wheel
1212

1313
call cd release/one_click_windows_gui
14-
call pip install "../../dist/picassosr-0.6.4-py3-none-any.whl"
14+
call pip install "../../dist/picassosr-0.6.5-py3-none-any.whl"
1515

1616
call pip install pyinstaller==5.7
1717
call pyinstaller ../pyinstaller/picasso.spec -y --clean

release/one_click_windows_gui/picasso_innoinstaller.iss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[Setup]
22
AppName=Picasso
33
AppPublisher=Jungmann Lab, Max Planck Institute of Biochemistry
4-
AppVersion=0.6.4
4+
AppVersion=0.6.5
55
DefaultDirName={commonpf}\Picasso
66
DefaultGroupName=Picasso
7-
OutputBaseFilename="Picasso-Windows-64bit-0.6.4"
7+
OutputBaseFilename="Picasso-Windows-64bit-0.6.5"
88
ArchitecturesAllowed=x64
99
ArchitecturesInstallIn64BitMode=x64
1010

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name="picassosr",
11-
version="0.6.4",
11+
version="0.6.5",
1212
author="Joerg Schnitzbauer, Maximilian T. Strauss, Rafal Kowalewski",
1313
author_email=("joschnitzbauer@gmail.com, straussmaximilian@gmail.com, rafalkowalewski998@gmail.com"),
1414
url="https://github.com/jungmannlab/picasso",

0 commit comments

Comments
 (0)