Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.7.4 #509

Merged
merged 18 commits into from
Dec 14, 2024
Merged

0.7.4 #509

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
402a646
RESI dialog FIX, units in nm
rafalkowalewski1 Oct 15, 2024
6d49c52
display the last loaded file in Render after closing a channel
rafalkowalewski1 Oct 15, 2024
d168a3a
CLEAN; FIX - saved picked locs metadata total area for circular pick
rafalkowalewski1 Dec 6, 2024
e7bef7e
CMD localize saves camera information in the metadata file
rafalkowalewski1 Dec 6, 2024
77675be
Render show drift in nm
rafalkowalewski1 Dec 6, 2024
a47615b
Picasso: Render - masking localizations saves the mask area in metadata
rafalkowalewski1 Dec 6, 2024
f5927ff
AIM undrifting and applying drift from txt yield the same result
rafalkowalewski1 Dec 8, 2024
7e3acf9
Test clusterer keyboard tracking
rafalkowalewski1 Dec 8, 2024
55bd4de
Change function inputs for render gui's (h)dbscan to match the patter…
rafalkowalewski1 Dec 8, 2024
c449bda
AIM from CMD, remove --mode from CMD undrift
rafalkowalewski1 Dec 8, 2024
eb4688b
Render: scale bar is automatically adjusted based on the current FOV'…
rafalkowalewski1 Dec 9, 2024
bbe1c4e
export channels in grayscale
rafalkowalewski1 Dec 14, 2024
a09b8f3
FIX automatic scale bar
rafalkowalewski1 Dec 14, 2024
eb281f6
Rotation window screenshot saves metadata and extra view with scale bar
rafalkowalewski1 Dec 14, 2024
ac6f7db
automatic scalebar length adjustment for rotation window
rafalkowalewski1 Dec 14, 2024
e8a561a
CLEAN
rafalkowalewski1 Dec 14, 2024
a3e4961
Bump version: 0.7.3 → 0.7.4
rafalkowalewski1 Dec 14, 2024
45d2713
Merge pull request #508 from rafalkowalewski1/development
rafalkowalewski1 Dec 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.7.3
current_version = 0.7.4
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
Expand Down
12 changes: 10 additions & 2 deletions changelog.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
Changelog
=========

Last change: 02-OCT-2024 MTS
Last change: 14-DEC-2024 MTS

0.7.1 - 0.7.3
0.7.1 - 0.7.4
-------------
- SMLM clusterer in picked regions deleted
- Show legend in Render property displayed rounded tick label values
- Pick circular area does not save the area for each pick in localization's metadata
- Picasso: Render - adjust the scale bar's size automatically based on the current FOV's width
- Picasso: Render - RESI dialog fixed, units in nm
- Picasso: Render - show drift in nm, not camera pixels
- Picasso: Render - masking localizations saves the mask area in its metadata
- Picasso: Render - export current view across channels in grayscale
- Picasso: Render - title bar displays the file only the names of the currently opened files
- CMD implementation of AIM undrifting, see ``picasso aim -h`` in terminal
- CMD localize saves camera information in the metadata file
- Other minor bug fixes

0.7.0
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.7.3
AppVersion=0.7.4
DefaultDirName={commonpf}\Picasso
DefaultGroupName=Picasso
OutputBaseFilename="Picasso-Windows-64bit-0.7.3"
OutputBaseFilename="Picasso-Windows-64bit-0.7.4"
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64

Expand Down
4 changes: 4 additions & 0 deletions docs/cmd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ undrift
-------
Correct localization coordinates for drift with RCC.

aim
-------
Correct localization coordinates for drift with AIM.

density
-------
Compute the local density of localizations
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.7.3"
release = "0.7.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.7.3"
__version__ = "0.7.4"

_this_file = _ospath.abspath(__file__)
_this_dir = _ospath.dirname(_this_file)
Expand Down
77 changes: 71 additions & 6 deletions picasso/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,26 @@ def _undrift(files, segmentation, display=True, fromfile=None):
savetxt(base + "_drift.txt", drift, header="dx\tdy", newline="\r\n")


def _undrift_aim(
files, segmentation, intersectdist=20/130, roiradius=60/130
):
import glob
from . import io, aim
from numpy import savetxt

paths = glob.glob(files)
for path in paths:
try:
locs, info = io.load_locs(path)
except io.NoMetadataFileError:
continue
print("Undrifting file {}".format(path))
locs, new_info, drift = aim.aim(locs, info, segmentation, intersectdist, roiradius)
base, ext = os.path.splitext(path)
io.save_locs(base + "_aim.hdf5", locs, new_info)
savetxt(base + "_aimdrift.txt", drift, header="dx\tdy", newline="\r\n")


def _density(files, radius):
import glob

Expand Down Expand Up @@ -985,6 +1005,7 @@ def prompt_info():
print("------------------------------------------")

info.append(localize_info)
info.append(camera_info)

base, ext = splitext(path)

Expand Down Expand Up @@ -1210,12 +1231,12 @@ def main():
" specified by a unix style path pattern"
),
)
undrift_parser.add_argument(
"-m",
"--mode",
default="render",
help='"std", "render" or "framepair")',
)
# undrift_parser.add_argument(
# "-m",
# "--mode",
# default="render",
# help='"std", "render" or "framepair")',
# )
undrift_parser.add_argument(
"-s",
"--segmentation",
Expand All @@ -1239,6 +1260,48 @@ def main():
help="do not display estimated drift",
)

# undrift by AIM parser
undrift_aim_parser = subparsers.add_parser(
"aim", help="correct localization coordinates for drift with AIM"
)
undrift_aim_parser.add_argument(
"files",
help=(
"one or multiple hdf5 localization files"
" specified by a unix style path pattern"
),
)
undrift_aim_parser.add_argument(
"-s",
"--segmentation",
type=float,
default=100,
help=(
"the number of frames to be combined"
" for one temporal segment (default=100)"
),
)
undrift_aim_parser.add_argument(
"-i",
"--intersectdist",
type=float,
default=20/130,
help=(
"max. distance (cam. pixels) between localizations in"
" consecutive segments to be considered as intersecting"
),
)
undrift_aim_parser.add_argument(
"-r",
"--roiradius",
type=float,
default=60/130,
help=(
"max. drift (cam. pixels) between two consecutive"
" segments"
),
)

# local densitydd
density_parser = subparsers.add_parser(
"density", help="compute the local density of localizations"
Expand Down Expand Up @@ -1708,6 +1771,8 @@ def main():
)
elif args.command == "undrift":
_undrift(args.files, args.segmentation, args.nodisplay, args.fromfile)
elif args.command == "aim":
_undrift_aim(args.files, args.segmentation, args.intersectdist, args.roiradius)
elif args.command == "density":
_density(args.files, args.radius)
elif args.command == "dbscan":
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.7.3"
VERSION_NO = "0.7.4"
18 changes: 13 additions & 5 deletions picasso/aim.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,8 @@ def aim(
-------
locs : _np.rec.array
Undrifted localizations.
new_info : list of 1 dict
Updated metadata.
drift : _np.rec.array
Drift in x and y directions (and z if applicable).
"""
Expand Down Expand Up @@ -686,9 +688,13 @@ def aim(
drift_x = drift_x1 + drift_x2
drift_y = drift_y1 + drift_y2

# # shift the drifts by the mean value
drift_x -= _np.mean(drift_x)
drift_y -= _np.mean(drift_y)
# shift the drifts by the mean value
shift_x = _np.mean(drift_x)
shift_y = _np.mean(drift_y)
drift_x -= shift_x
drift_y -= shift_y
x_pdc += shift_x
y_pdc += shift_y

# combine to Picasso format
drift = _np.rec.array((drift_x, drift_y), dtype=[("x", "f"), ("y", "f")])
Expand All @@ -713,7 +719,9 @@ def aim(
aim_round=2, progress=progress,
)
drift_z = drift_z1 + drift_z2
drift_z -= _np.mean(drift_z)
shift_z = _np.mean(drift_z)
drift_z -= shift_z
z_pdc += shift_z
drift = _np.rec.array(
(drift_x, drift_y, drift_z),
dtype=[("x", "f"), ("y", "f"), ("z", "f")]
Expand All @@ -726,7 +734,7 @@ def aim(
locs["z"] = z_pdc

new_info = {
"Undrifted by": "AIM",
"Generated by": "AIM undrift",
"Intersect distance (nm)": intersect_d * pixelsize,
"Segmentation": segmentation,
"Search regions radius (nm)": roi_r * pixelsize,
Expand Down
Loading
Loading