Skip to content

Commit

Permalink
Merge pull request #388 from jungmannlab/development
Browse files Browse the repository at this point in the history
RCC error solve, remove tqdm from gui
  • Loading branch information
rafalkowalewski1 authored Sep 30, 2023
2 parents 8c06566 + 71b1ed3 commit 4119ee5
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.6.3
current_version = 0.6.4
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ target/
# Mac Desktop Service Store
**/.DS_Store

# vscode settings
.vscode/

# Jupyter Notebook
.ipynb_checkpoints

Expand Down
4 changes: 4 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions distribution/picasso.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion picasso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion picasso/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION_NO = "0.6.3"
VERSION_NO = "0.6.4"
9 changes: 4 additions & 5 deletions picasso/gui/average3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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():
Expand Down
5 changes: 1 addition & 4 deletions picasso/gui/nanotron.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import sys
import traceback
import importlib, pkgutil
from tqdm import tqdm
import datetime
from time import sleep

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion picasso/gui/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
23 changes: 15 additions & 8 deletions picasso/imageprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions picasso/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions picasso/postprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
]
Expand Down
4 changes: 2 additions & 2 deletions release/one_click_windows_gui/create_installer_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ 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

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
Expand Down
4 changes: 2 additions & 2 deletions release/one_click_windows_gui/picasso_innoinstaller.iss
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=("[email protected], [email protected], [email protected]"),
url="https://github.com/jungmannlab/picasso",
Expand Down

0 comments on commit 4119ee5

Please sign in to comment.