Skip to content

Commit 51e9ec3

Browse files
Merge pull request #322 from jungmannlab/development
Development
2 parents 7f4d285 + ab8ee77 commit 51e9ec3

23 files changed

+513
-60
lines changed

.bumpversion.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.5.7
2+
current_version = 0.6.0
33
commit = True
44
tag = False
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
@@ -13,6 +13,8 @@ serialize =
1313

1414
[bumpversion:file:./distribution/picasso.iss]
1515

16+
[bumpversion:file:./picasso/__init__.py]
17+
1618
[bumpversion:file:./picasso/__version__.py]
1719

1820
[bumpversion:file:./release/one_click_windows_gui/picasso_innoinstaller.iss]

changelog.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
Changelog
22
=========
33

4-
Last change: 07-FEB-2023 MTS
4+
Last change: 16-FEB-2023 MTS
5+
6+
0.6.0
7+
-----
8+
- New RESI (Resolution Enhancement by Sequential Imaging) dialog in Picasso Render allowing for a substantial resolution boost, (*to be published*)
9+
- Remove quantum efficiency when converting raw data into photons in Picasso Localize
10+
- Input ROI using command-line ``picasso localize``, see `here <https://picassosr.readthedocs.io/en/latest/cmd.html>`_.
511

612
0.5.7
713
-----

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.5.7
5+
AppVersion=0.6.0
66
DefaultDirName={pf}\Picasso
77
DefaultGroupName=Picasso
8-
OutputBaseFilename="Picasso-Windows-64bit-0.5.7"
8+
OutputBaseFilename="Picasso-Windows-64bit-0.6.0"
99
ArchitecturesAllowed=x64
1010
ArchitecturesInstallIn64BitMode=x64
1111

docs/cmd.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ The reconstruction parameters can be specified by adding respective arguments. I
2727
‘-a’, ‘–fit-method’, choices=["mle", "lq", "lq-gpu", "lq-3d", "lq-gpu-3d", "avg"], default=‘mle’
2828
‘-g’, ‘–gradient’, type=int, default=5000, help=‘minimum net gradient’
2929
‘-d’, ‘–drift’, type=int, default=1000, help=‘segmentation size for subsequent RCC, 0 to deactivate’
30+
‘-r’, ‘-roi‘, type=int, nargs=4, default=None, help=‘ROI (y_min, x_min, y_max, x_max) in camera pixels’
3031
‘-bl’, ‘–baseline’, type=int, default=0, help=‘camera baseline’
3132
‘-s’, ‘–sensitivity’, type=int, default=1, help=‘camera sensitivity’
3233
‘-ga’, ‘–gain’, type=int, default=1, help=‘camera gain’

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.5.7"
29+
release = "0.6.0"
3030

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

docs/localize.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Localize allows performing super-resolution reconstruction of image stacks. For
99

1010
- MLE, integrated Gaussian (based on `Smith et al., 2014 <https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2862147/>`_.)
1111
- LQ, Gaussian (least squares)
12-
- Average of ROI
12+
- Average of ROI (finds summed intensity of spots)
13+
14+
**Please note:** Picasso Localize supports five file formats: ``.ome.tif``, ``NDTiffStack`` with extension ``.tif``, ``.raw``, ``.ims`` and ``.nd2``. If your file has the extension ``.tiff`` or ``.ome.tiff``, it cannot be read. Usually it is enough to change the extension to ``.ome.tif``, i.e., remove the last letter.
1315

1416
Identification and fitting of single-molecule spots
1517
---------------------------------------------------

docs/render.rst

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Redundant cross-correlation drift correction
2626
Marker-based drift correction
2727
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2828

29-
1. In ``Picasso: Render``, pick drift markers as described in ``Picking of regions of interest``. Use the ``Pick similar`` option to automatically detect a large number of drift markers similar to a few manually selected ones.
29+
1. In ``Picasso: Render``, pick drift markers as described in **Picking of regions of interest**. Use the ``Pick similar`` option to automatically detect a large number of drift markers similar to a few manually selected ones.
3030
2. If the structures used as drift markers have an intrinsic size larger than the precision of individual localizations (e.g., DNA origami, large protein complexes), it is critical to select a large number of structures. Otherwise, the statistic for calculating the drift in each frame (the mean displacement of localization to the structure's center of mass) is not valid.
3131
3. Select ``Postprocess > Undrift from picked`` to compute and apply the drift correction.
3232
4. (Optional) Save the drift-corrected localizations by selecting ``File > Save localizations``.
@@ -54,6 +54,21 @@ Rotation around z-axis is available by pressing Ctrl/Command. Rotation axis can
5454

5555
There are several things to keep in mind when using the rotation window. Firstly, using individual localization precision is very slow and is not recommended as a default blur method. Also, the size of the rotation window can be altered, however, if it becomes too large, rendering may start to lag.
5656

57+
RESI
58+
----
59+
.. image:: ../docs/render_resi.png
60+
:width: 374
61+
:alt: UML Render RESI
62+
63+
64+
In Picasso 0.6.0, a new RESI (Resolution Enhancement by Sequential Imaging) dialog was introduced. It allows for a substantial resolution boost by sequential imaging of a single target with multiple labels with Exchange-PAINT (*to be published*).
65+
66+
To use RESI, prepare your individual RESI channels (localization, undrifting, filtering and **alignment**). Load such localization lists into Picasso Render and open ``Postprocess > RESI``. The dialog shown above will appear. Each channel will be clustered using the SMLM clusterer (other clustering algorithms could be applied as well although only the SMLM clusterer is implemented for RESI in Picasso). Clustering parameters can be defined for each RESI channel individually, although it is possible to apply the same parameters to all channels by clicking ``Apply the same clustering parameters to all channels``, which will copy the clustering parameters from the first row and paste it to all other channels.
67+
68+
Next, the user needs to specify whether or not to save clustered localizations or cluster centers from each of the RESI channels individually, and whether to apply basic frame analysis (to minimize the effect of sticking events). For the explanation of the parameters, see `SMLM clusterer <https://picassosr.readthedocs.io/en/latest/render.html#smlm-clusterer>`_.
69+
70+
Upon clicking ``Perform RESI analysis``, each of the loaded channels is clustered, cluster centers are extracted and combined from all RESI channels to create the final RESI file.
71+
5772
Dialogs
5873
-------
5974

@@ -378,7 +393,11 @@ Apply expressions to localizations
378393
This tool allows you to apply expressions to localizations, for example:
379394

380395
- ``x +=1`` will shift all localization by one to the right
381-
- ``x +=1;y+=1`` will shift all localization by one to the right and one up.
396+
- ``x +=1; y+=1`` will shift all localization by one to the right and one up.
397+
- ``flip x z`` will exchange the x-axis with y-axis if z localizations are present (side projection), similar for ``flip y z``.
398+
- ``spiral r n`` will plot each localization over the time of the movie in a spiral with radius r and n number of turns (e.g., to detect repetitive binding), ``uspiral`` to reverse.
399+
400+
**NOTE:** using two variables in one statement is not supported (e.g. ``x = y``) To filter localizations use picasso filter.
382401

383402
DBSCAN
384403
^^^^^^
@@ -390,23 +409,21 @@ Cluster localizations with the hdbscan clustering algorithm.
390409

391410
SMLM clusterer
392411
^^^^^^^^^^^^^^
393-
Cluster localizations with the custom algorithm designed for SMLM. In short, localizations with the maximum number of neighboring localizations within a user-defined radius are chosen as cluster centers, around which all localizations withing the given radius belong to one cluster. If two or more such clusters overlap, they are combined.
412+
Cluster localizations with the custom algorithm designed for SMLM. In short, localizations with the maximum number of neighboring localizations within a user-defined radius are chosen as cluster centers, around which all localizations within the given radius belong to one cluster. If two or more local maxima are within the radius, the clusters are merged.
413+
414+
SMLM clusterer requires three (or four if 3D data is processed) arguments:
415+
416+
- Radius: final size of the clusters.
417+
- Radius z (3D only): final size of the clusters in the z axis. If the value is different from radius in xy plane, clusters have ellipsoidal shape. Radius z can have a different value to account for a difference in localization precision in lateral and axial directions.
418+
- Min. locs: minimum number of localizations in a cluster.
419+
- Basic frame analysis: If True, each cluster is checked for its value of mean frame (if it is within the first or the last 20% of the total acquisition time, it is discarded). Moreover, localizations inside each cluster are split into 20 time bins (across the whole acquisition time). If a single time bin contains more than 80% of localizations per cluster, the cluster is discarded.
394420

395-
*NOTE:* it is highly recommended to remove any fiducial markers before clustering, to lower clustering time, given they are of no interest to the user. To do that, the markers can be picked and removed using ``Tools > Remove localizations in picks``.
421+
**Note to all clustering algorithms:** it is highly recommended to remove any fiducial markers before clustering, to lower clustering time, given they are of no interest to the user. To do that, the markers can be picked and removed using ``Tools > Remove localizations in picks``.
396422

397423
Test clusterer
398424
^^^^^^^^^^^^^^
399425
Opens a dialog where different clustering parameters can be checked on the loaded dataset. Requires a single pick region of interest to be selected.
400426

401427
Nearest Neighbor Analysis
402428
^^^^^^^^^^^^^^^^^^^^^^^^^
403-
Calculates distances to the ``k``-th nearest neighbors between two channels (can be the same channel). ``k`` is defined by the user. The distances are stored in nm as a .csv file.
404-
405-
Notes
406-
+++++
407-
Using two variables in one statement is not supported (e.g. ``x = y``) To filter localizations use picasso filter.
408-
409-
Additional commands
410-
+++++++++++++++++++
411-
``flip x z`` will exchange the x-axis with y-axis if z localizations are present (side projection), similar for ``flip y z``.
412-
``spiral r n`` will plot each localization over the time of the movie in a spiral with radius r and n number of turns (e.g., to detect repetitive binding), ``uspiral`` to reverse.
429+
Calculates distances to the ``k``-th nearest neighbors between two channels (can be the same channel). ``k`` is defined by the user. The distances are stored in nm as a .csv file.

docs/render_resi.png

11.9 KB
Loading

picasso/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22
picasso/__init__.py
33
~~~~~~~~~~~~~~~~~~~~
44
5-
:authors: Joerg Schnitzbauer, Maximilian Thomas Strauss, 2016-2018
5+
:authors: Joerg Schnitzbauer, Maximilian Thomas Strauss, Rafal Kowalewski 2016-2023
66
:copyright: Copyright (c) 2016-2018 Jungmann Lab, MPI of Biochemistry
77
"""
88
import os.path as _ospath
99
import yaml as _yaml
1010

11+
__version__ = "0.6.0"
1112

1213
_this_file = _ospath.abspath(__file__)
1314
_this_dir = _ospath.dirname(_this_file)
@@ -17,4 +18,4 @@
1718
if CONFIG is None:
1819
CONFIG = {}
1920
except FileNotFoundError:
20-
CONFIG = {}
21+
CONFIG = {}

picasso/__main__.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,6 @@ def _localize(args):
760760
locs_from_fits,
761761
add_file_to_db,
762762
)
763-
764763
from os.path import splitext, isdir
765764
from time import sleep
766765
from . import gausslq, avgroi
@@ -780,7 +779,10 @@ def _localize(args):
780779
raise Exception("GPUfit not installed. Aborting.")
781780

782781
for index, element in enumerate(vars(args)):
783-
print("{:<8} {:<15} {:<10}".format(index + 1, element, getattr(args, element)))
782+
try:
783+
print("{:<8} {:<15} {:<10}".format(index + 1, element, getattr(args, element)))
784+
except TypeError: # if None is default value
785+
print("{:<8} {:<15} {}".format(index + 1, element, "None"))
784786
print("------------------------------------------")
785787

786788
def check_consecutive_tif(filepath):
@@ -849,8 +851,13 @@ def prompt_info():
849851
save_info(info_path, [info])
850852

851853
if paths:
854+
print(args)
852855
box = args.box_side_length
853856
min_net_gradient = args.gradient
857+
roi = args.roi
858+
if roi is not None:
859+
y_min, x_min, y_max, x_max = roi
860+
roi = [[y_min, x_min], [y_max, x_max]]
854861
camera_info = {}
855862
camera_info["baseline"] = args.baseline
856863
camera_info["sensitivity"] = args.sensitivity
@@ -898,7 +905,7 @@ def prompt_info():
898905
print("Processing {}, File {} of {}".format(path, i + 1, len(paths)))
899906
print("------------------------------------------")
900907
movie, info = load_movie(path)
901-
current, futures = identify_async(movie, min_net_gradient, box)
908+
current, futures = identify_async(movie, min_net_gradient, box, roi=roi)
902909
n_frames = len(movie)
903910
while current[0] < n_frames:
904911
print(
@@ -1435,6 +1442,17 @@ def main():
14351442
default=1000,
14361443
help="segmentation size for subsequent RCC, 0 to deactivate",
14371444
)
1445+
localize_parser.add_argument(
1446+
"-r",
1447+
"--roi",
1448+
type=int,
1449+
nargs=4,
1450+
default=None,
1451+
help=(
1452+
"ROI (y_min, x_min, y_max, x_max) in camera pixels;\n"
1453+
"note the origin of the image is in the top left corner"
1454+
),
1455+
)
14381456
localize_parser.add_argument(
14391457
"-bl", "--baseline", type=int, default=0, help="camera baseline"
14401458
)
@@ -1468,7 +1486,7 @@ def main():
14681486
default="",
14691487
help="Suffix to add to files",
14701488
)
1471-
1489+
14721490
localize_parser.add_argument(
14731491
"-db",
14741492
"--database",

picasso/__version__.py

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

0 commit comments

Comments
 (0)