Skip to content

Commit 5bf3596

Browse files
authored
Merge pull request #244 from funkelab/209-update-to-geff-v1-compatibility
Update for compatibility with geff >= 1.1.1.1.1
2 parents 4c6d5d6 + 6a3d14f commit 5bf3596

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ classifiers = [
3030

3131
dependencies =[
3232
"napari>=0.5,<1",
33-
"funtracks>=1.3.0,<2",
33+
"funtracks>=1.4.0,<2",
3434
"appdirs>=1,<2",
35-
"numpy >= 1.26,<2.1",
35+
"numpy>=2,<3",
3636
"magicgui>=0.10.1",
3737
"qtpy>=2.4,<3",
3838
"scikit-image>=0.25",

src/motile_tracker/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def main():
1414
main_app.menu_widget.tabwidget.addTab(motile_widget, "Track with Motile")
1515
viewer.window.add_dock_widget(main_app)
1616

17-
# Start finn event loop
17+
# Start napari event loop
1818
napari.run()
1919

2020

src/motile_tracker/import_export/menus/import_from_geff/geff_scale_widget.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import numpy as np
2-
from geff.affine import Affine
31
from qtpy.QtCore import Qt
42
from qtpy.QtWidgets import (
53
QDoubleSpinBox,
@@ -44,22 +42,23 @@ def __init__(self):
4442
def _prefill_from_metadata(self, metadata: dict) -> None:
4543
"""Update the scale widget, prefilling with metadata information if possible.
4644
Args:
47-
metadata (dict): geff metadata dictionary containing 'affine' and 'axes' keys.
45+
metadata (dict): geff metadata dictionary containing 'axes' key with scaling
46+
information.
4847
"""
4948

5049
if len(metadata) > 0:
5150
self.setVisible(True)
5251
clear_layout(self.scale_layout)
5352
self.scale_form_layout = QFormLayout()
5453

55-
affine = metadata.get("affine")
56-
if affine is not None:
57-
affine = affine.get("matrix", None)
58-
affine = Affine(matrix=affine)
59-
linear = affine.linear_matrix
60-
self.scale = tuple(np.diag(linear))
61-
else:
62-
self.scale = [1] * len(metadata.get("axes"))
54+
# read scaling information from metadata, prefill with 1 for all axes if not
55+
# given
56+
self.scale = list([1.0] * len(metadata.get("axes")))
57+
axes = metadata.get("axes", [])
58+
lookup = {a["name"].lower(): a.get("scale", 1) or 1 for a in axes}
59+
self.scale[-1], self.scale[-2] = lookup.get("x", 1), lookup.get("y", 1)
60+
if "z" in lookup:
61+
self.scale[-3] = lookup.get("z", 1)
6362

6463
# Spinboxes for scaling in (z), y, x.
6564
self.z_label = QLabel("z")

0 commit comments

Comments
 (0)