diff --git a/.bumpversion.cfg b/.bumpversion.cfg index da2bb026..96e2c560 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.6.3 +current_version = 0.6.4 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/.gitignore b/.gitignore index 20c147a4..474fd486 100644 --- a/.gitignore +++ b/.gitignore @@ -77,6 +77,9 @@ target/ # Mac Desktop Service Store **/.DS_Store +# vscode settings +.vscode/ + # Jupyter Notebook .ipynb_checkpoints diff --git a/changelog.rst b/changelog.rst index 11f14c3b..846a15eb 100644 --- a/changelog.rst +++ b/changelog.rst @@ -3,6 +3,10 @@ Changelog Last change: 26-SEP-2023 MTS +0.6.4 +----- +- Fix RCC error for Render GUI (one click installer) (remove tqdm from GUI) + 0.6.3 ----- - Dependencies updated diff --git a/distribution/picasso.iss b/distribution/picasso.iss index b384c3cf..91123177 100644 --- a/distribution/picasso.iss +++ b/distribution/picasso.iss @@ -2,10 +2,10 @@ AppName=Picasso AppPublisher=Jungmann Lab, Max Planck Institute of Biochemistry -AppVersion=0.6.3 +AppVersion=0.6.4 DefaultDirName={commonpf}\Picasso DefaultGroupName=Picasso -OutputBaseFilename="Picasso-Windows-64bit-0.6.3" +OutputBaseFilename="Picasso-Windows-64bit-0.6.4" ArchitecturesAllowed=x64 ArchitecturesInstallIn64BitMode=x64 diff --git a/docs/conf.py b/docs/conf.py index ef4e85dd..cfd449c4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ # The short X.Y version version = "" # The full version, including alpha/beta/rc tags -release = "0.6.3" +release = "0.6.4" # -- General configuration --------------------------------------------------- diff --git a/picasso/__init__.py b/picasso/__init__.py index 77603823..7a1509ed 100644 --- a/picasso/__init__.py +++ b/picasso/__init__.py @@ -8,7 +8,7 @@ import os.path as _ospath import yaml as _yaml -__version__ = "0.6.3" +__version__ = "0.6.4" _this_file = _ospath.abspath(__file__) _this_dir = _ospath.dirname(_this_file) diff --git a/picasso/__version__.py b/picasso/__version__.py index be872534..3bde8761 100644 --- a/picasso/__version__.py +++ b/picasso/__version__.py @@ -1 +1 @@ -VERSION_NO = "0.6.3" +VERSION_NO = "0.6.4" diff --git a/picasso/gui/average3.py b/picasso/gui/average3.py index 491b520a..aa0eb27a 100644 --- a/picasso/gui/average3.py +++ b/picasso/gui/average3.py @@ -25,7 +25,6 @@ from numpy.lib.recfunctions import stack_arrays from cmath import rect, phase -from tqdm import tqdm import scipy.ndimage.filters import importlib, pkgutil @@ -874,7 +873,7 @@ def translate(self, translateaxis): plt.plot(element) n_groups = self.group_index[0].shape[0] print("Translating..") - for i in tqdm(range(n_groups)): + for i in range(n_groups): self.status_bar.showMessage("Group {} / {}.".format(i, n_groups)) self.translate_group(signalimg, i, translateaxis) @@ -1221,7 +1220,7 @@ def rotatexy_convolution(self): CF_image_avg = image print("Convolving..") - for i in tqdm(range(n_groups)): + for i in range(n_groups): self.status_bar.showMessage("Group {} / {}.".format(i, n_groups)) self.rotatexy_convolution_group(CF_image_avg, angles, i, rotaxis, proplane) self.updateLayout() @@ -1360,7 +1359,7 @@ def rotate_groups(self): # image_half = n_pixel / 2 print("Rotating..") - for i in tqdm(range(n_groups)): + for i in range(n_groups): self.status_bar.showMessage("Group {} / {}.".format(i, n_groups)) self.align_group(CF_image_avg, angles, i, rotaxis, proplane) self.updateLayout() @@ -1485,7 +1484,7 @@ def calculate_score(self): n_channels = len(image) print("Calculating score..") - for i in tqdm(range(n_groups)): + for i in range(n_groups): channel_score = [] for j in range(n_channels): if self.dataset_dialog.checks[j].isChecked(): diff --git a/picasso/gui/nanotron.py b/picasso/gui/nanotron.py index 78ba73f4..d9b85425 100644 --- a/picasso/gui/nanotron.py +++ b/picasso/gui/nanotron.py @@ -13,7 +13,6 @@ import sys import traceback import importlib, pkgutil -from tqdm import tqdm import datetime from time import sleep @@ -94,9 +93,7 @@ def run(self): export_path = _ospath.dirname(self.export_paths[id]) + "/" - for c, pick in enumerate( - tqdm(np.unique(locs.group), desc="Prepare class " + str(label)) - ): + for c, pick in enumerate(np.unique(locs.group)): pick_img = nanotron.roi_to_img( locs=locs, diff --git a/picasso/gui/render.py b/picasso/gui/render.py index bc8a0f03..4f19c916 100644 --- a/picasso/gui/render.py +++ b/picasso/gui/render.py @@ -10054,7 +10054,7 @@ def update_cursor(self): diameter = int(self.width() * diameter / self.viewport_width()) # remote desktop crashes sometimes for high diameter if diameter < 100: - pixmap_size = ceil(diameter) + pixmap_size = ceil(diameter) + 1 pixmap = QtGui.QPixmap(pixmap_size, pixmap_size) pixmap.fill(QtCore.Qt.transparent) painter = QtGui.QPainter(pixmap) diff --git a/picasso/imageprocess.py b/picasso/imageprocess.py index 97dce1ad..892488b5 100644 --- a/picasso/imageprocess.py +++ b/picasso/imageprocess.py @@ -110,18 +110,25 @@ def rcc(segments, max_shift=None, callback=None): shifts_y = _np.zeros((n_segments, n_segments)) n_pairs = int(n_segments * (n_segments - 1) / 2) flag = 0 - with _tqdm( - total=n_pairs, desc="Correlating image pairs", unit="pairs" - ) as progress_bar: - if callback is not None: - callback(0) + if callback is None: + with _tqdm( + total=n_pairs, desc="Correlating image pairs", unit="pairs" + ) as progress_bar: + for i in range(n_segments - 1): + for j in range(i + 1, n_segments): + progress_bar.update() + shifts_y[i, j], shifts_x[i, j] = get_image_shift( + segments[i], segments[j], 5, max_shift + ) + flag += 1 + else: + callback(0) for i in range(n_segments - 1): for j in range(i + 1, n_segments): - progress_bar.update() shifts_y[i, j], shifts_x[i, j] = get_image_shift( segments[i], segments[j], 5, max_shift ) flag += 1 - if callback is not None: - callback(flag) + callback(flag) + return _lib.minimize_shifts(shifts_x, shifts_y) diff --git a/picasso/io.py b/picasso/io.py index 831d4030..337da000 100644 --- a/picasso/io.py +++ b/picasso/io.py @@ -190,8 +190,8 @@ def load_movie(path, prompt_info=None, progress=None): return load_ims(path, prompt_info=prompt_info) elif ext == '.nd2': return load_nd2(path) - elif ext == ".tiff": - print("Extension .tiff not supported, please use .ome.tif instead.") + # elif ext == ".tiff": + # print("Extension .tiff not supported, please use .ome.tif instead.") def load_info(path, qt_parent=None): path_base, path_extension = _ospath.splitext(path) diff --git a/picasso/postprocess.py b/picasso/postprocess.py index 57f22c55..2af1b7c9 100644 --- a/picasso/postprocess.py +++ b/picasso/postprocess.py @@ -1057,9 +1057,12 @@ def segment(locs, info, segmentation, kwargs={}, callback=None): n_seg = n_segments(info, segmentation) bounds = _np.linspace(0, n_frames - 1, n_seg + 1, dtype=_np.uint32) segments = _np.zeros((n_seg, Y, X)) - if callback is not None: + if callback is None: + it = _trange(n_seg, desc="Generating segments", unit="segments") + else: callback(0) - for i in _trange(n_seg, desc="Generating segments", unit="segments"): + it = range(n_seg) + for i in it: segment_locs = locs[ (locs.frame >= bounds[i]) & (locs.frame < bounds[i + 1]) ] diff --git a/release/one_click_windows_gui/create_installer_windows.bat b/release/one_click_windows_gui/create_installer_windows.bat index 8b6d016a..be67a0e9 100644 --- a/release/one_click_windows_gui/create_installer_windows.bat +++ b/release/one_click_windows_gui/create_installer_windows.bat @@ -3,7 +3,7 @@ call DEL /F/Q/S dist > NUL call RMDIR /Q/S build call RMDIR /Q/S dist -call cd %~dp0\..\..\.. +call cd %~dp0\..\.. call conda create -n picasso_installer python=3.10 -y call conda activate picasso_installer @@ -11,7 +11,7 @@ call conda activate picasso_installer call python setup.py sdist bdist_wheel call cd release/one_click_windows_gui -call pip install "../../dist/picassosr-0.6.3-py3-none-any.whl" +call pip install "../../dist/picassosr-0.6.4-py3-none-any.whl" call pip install pyinstaller==5.7 call pyinstaller ../pyinstaller/picasso.spec -y --clean diff --git a/release/one_click_windows_gui/picasso_innoinstaller.iss b/release/one_click_windows_gui/picasso_innoinstaller.iss index 771b2092..809a769b 100644 --- a/release/one_click_windows_gui/picasso_innoinstaller.iss +++ b/release/one_click_windows_gui/picasso_innoinstaller.iss @@ -1,10 +1,10 @@ [Setup] AppName=Picasso AppPublisher=Jungmann Lab, Max Planck Institute of Biochemistry -AppVersion=0.6.3 +AppVersion=0.6.4 DefaultDirName={commonpf}\Picasso DefaultGroupName=Picasso -OutputBaseFilename="Picasso-Windows-64bit-0.6.3" +OutputBaseFilename="Picasso-Windows-64bit-0.6.4" ArchitecturesAllowed=x64 ArchitecturesInstallIn64BitMode=x64 diff --git a/setup.py b/setup.py index 7bd7de77..43b39b22 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="picassosr", - version="0.6.3", + version="0.6.4", author="Joerg Schnitzbauer, Maximilian T. Strauss, Rafal Kowalewski", author_email=("joschnitzbauer@gmail.com, straussmaximilian@gmail.com, rafalkowalewski998@gmail.com"), url="https://github.com/jungmannlab/picasso",