pystackreg 0.2.7__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. pystackreg-0.3.0/AUTHORS.rst +41 -0
  2. pystackreg-0.3.0/CHANGELOG.rst +179 -0
  3. pystackreg-0.3.0/CITATION.cff +58 -0
  4. pystackreg-0.3.0/LICENSE +674 -0
  5. pystackreg-0.3.0/MANIFEST.in +10 -0
  6. pystackreg-0.3.0/NOTICE +109 -0
  7. pystackreg-0.3.0/PKG-INFO +360 -0
  8. pystackreg-0.2.7/PKG-INFO → pystackreg-0.3.0/README.rst +105 -149
  9. {pystackreg-0.2.7 → pystackreg-0.3.0}/docs/conf.py +15 -16
  10. pystackreg-0.3.0/docs/index.rst +38 -0
  11. pystackreg-0.3.0/docs/performance.rst +224 -0
  12. pystackreg-0.3.0/docs/reference/pystackreg.rst +34 -0
  13. pystackreg-0.3.0/docs/release.rst +91 -0
  14. pystackreg-0.3.0/docs/requirements.txt +3 -0
  15. pystackreg-0.3.0/docs/troubleshooting.rst +124 -0
  16. {pystackreg-0.2.7 → pystackreg-0.3.0}/docs/tutorial.rst +186 -48
  17. pystackreg-0.3.0/docs/tutorial_files/tutorial_13_0.png +0 -0
  18. pystackreg-0.3.0/docs/tutorial_files/tutorial_18_0.png +0 -0
  19. pystackreg-0.3.0/docs/tutorial_files/tutorial_24_0.png +0 -0
  20. pystackreg-0.3.0/docs/tutorial_files/tutorial_28_0.png +0 -0
  21. pystackreg-0.3.0/docs/tutorial_files/tutorial_32_0.png +0 -0
  22. pystackreg-0.3.0/docs/tutorial_files/tutorial_57_1.png +0 -0
  23. pystackreg-0.3.0/docs/usage.rst +321 -0
  24. pystackreg-0.3.0/docs/validation.rst +197 -0
  25. pystackreg-0.3.0/examples/notebooks/tutorial.ipynb +2881 -0
  26. {pystackreg-0.2.7 → pystackreg-0.3.0}/inc/TurboReg.h +39 -9
  27. {pystackreg-0.2.7 → pystackreg-0.3.0}/inc/TurboRegImage.h +50 -12
  28. pystackreg-0.3.0/inc/TurboRegMask.h +119 -0
  29. {pystackreg-0.2.7 → pystackreg-0.3.0}/inc/TurboRegPointHandler.h +39 -9
  30. {pystackreg-0.2.7 → pystackreg-0.3.0}/inc/TurboRegTransform.h +79 -15
  31. {pystackreg-0.2.7 → pystackreg-0.3.0}/inc/matrix.h +17 -0
  32. pystackreg-0.3.0/pyproject.toml +122 -0
  33. pystackreg-0.3.0/pystackreg/__init__.py +16 -0
  34. pystackreg-0.3.0/pystackreg/_internal.py +271 -0
  35. pystackreg-0.3.0/pystackreg/py.typed +0 -0
  36. pystackreg-0.3.0/pystackreg/pystackreg.py +814 -0
  37. pystackreg-0.3.0/pystackreg/util/__init__.py +181 -0
  38. pystackreg-0.3.0/pystackreg/version.py +1 -0
  39. pystackreg-0.3.0/pystackreg.egg-info/PKG-INFO +360 -0
  40. {pystackreg-0.2.7 → pystackreg-0.3.0}/pystackreg.egg-info/SOURCES.txt +32 -12
  41. pystackreg-0.3.0/pystackreg.egg-info/requires.txt +20 -0
  42. pystackreg-0.3.0/setup.py +52 -0
  43. {pystackreg-0.2.7 → pystackreg-0.3.0}/src/TurboReg.cpp +39 -9
  44. {pystackreg-0.2.7 → pystackreg-0.3.0}/src/TurboRegImage.cpp +50 -32
  45. {pystackreg-0.2.7 → pystackreg-0.3.0}/src/TurboRegMask.cpp +43 -12
  46. {pystackreg-0.2.7 → pystackreg-0.3.0}/src/TurboRegPointHandler.cpp +39 -9
  47. {pystackreg-0.2.7 → pystackreg-0.3.0}/src/TurboRegTransform.cpp +276 -232
  48. pystackreg-0.3.0/src/pymain.cpp +446 -0
  49. pystackreg-0.3.0/tests/conftest.py +56 -0
  50. pystackreg-0.3.0/tests/data/baseline_v0.2.8.npz +0 -0
  51. pystackreg-0.3.0/tests/data/pc12-reg-affine.tif +0 -0
  52. pystackreg-0.3.0/tests/data/pc12-reg-bilinear.tif +0 -0
  53. pystackreg-0.3.0/tests/data/pc12-reg-rigid-body.tif +0 -0
  54. pystackreg-0.3.0/tests/data/pc12-reg-scaled-rotation.tif +0 -0
  55. pystackreg-0.3.0/tests/data/pc12-reg-translation.tif +0 -0
  56. pystackreg-0.3.0/tests/data/pc12-unreg.tif +0 -0
  57. pystackreg-0.3.0/tests/generate_baseline.py +142 -0
  58. pystackreg-0.3.0/tests/helpers.py +182 -0
  59. pystackreg-0.3.0/tests/test_accuracy.py +258 -0
  60. pystackreg-0.3.0/tests/test_imagej_reference.py +108 -0
  61. pystackreg-0.3.0/tests/test_parallel.py +306 -0
  62. pystackreg-0.3.0/tests/test_points.py +170 -0
  63. pystackreg-0.3.0/tests/test_regression.py +118 -0
  64. pystackreg-0.3.0/tests/test_stack.py +358 -0
  65. pystackreg-0.3.0/tests/test_transform.py +199 -0
  66. pystackreg-0.3.0/tests/test_validation.py +314 -0
  67. pystackreg-0.3.0/tools/check_dist.py +122 -0
  68. pystackreg-0.3.0/tools/sanitize.sh +49 -0
  69. pystackreg-0.2.7/.codespellignore +0 -1
  70. pystackreg-0.2.7/.flake8 +0 -3
  71. pystackreg-0.2.7/.pre-commit-config.yaml +0 -43
  72. pystackreg-0.2.7/.readthedocs.yml +0 -24
  73. pystackreg-0.2.7/AUTHORS.rst +0 -5
  74. pystackreg-0.2.7/CHANGELOG.rst +0 -70
  75. pystackreg-0.2.7/LICENSE.txt +0 -45
  76. pystackreg-0.2.7/MANIFEST.in +0 -23
  77. pystackreg-0.2.7/README.rst +0 -254
  78. pystackreg-0.2.7/docs/+ +0 -18
  79. pystackreg-0.2.7/docs/import_ipynb.sh +0 -4
  80. pystackreg-0.2.7/docs/index.rst +0 -21
  81. pystackreg-0.2.7/docs/reference/pystackreg.rst +0 -25
  82. pystackreg-0.2.7/docs/requirements.txt +0 -4
  83. pystackreg-0.2.7/docs/tutorial_files/tutorial_13_0.png +0 -0
  84. pystackreg-0.2.7/docs/tutorial_files/tutorial_18_0.png +0 -0
  85. pystackreg-0.2.7/docs/tutorial_files/tutorial_24_0.png +0 -0
  86. pystackreg-0.2.7/docs/tutorial_files/tutorial_28_1.png +0 -0
  87. pystackreg-0.2.7/docs/tutorial_files/tutorial_32_0.png +0 -0
  88. pystackreg-0.2.7/examples/notebooks/tutorial.ipynb +0 -734
  89. pystackreg-0.2.7/inc/TurboRegMask.h +0 -89
  90. pystackreg-0.2.7/pyproject.toml +0 -8
  91. pystackreg-0.2.7/pystackreg/__init__.py +0 -3
  92. pystackreg-0.2.7/pystackreg/conftest.py +0 -2
  93. pystackreg-0.2.7/pystackreg/pystackreg.py +0 -481
  94. pystackreg-0.2.7/pystackreg/util/__init__.py +0 -106
  95. pystackreg-0.2.7/pystackreg/version.py +0 -1
  96. pystackreg-0.2.7/pystackreg.egg-info/PKG-INFO +0 -351
  97. pystackreg-0.2.7/pystackreg.egg-info/requires.txt +0 -2
  98. pystackreg-0.2.7/requirements.txt +0 -2
  99. pystackreg-0.2.7/setup.py +0 -74
  100. pystackreg-0.2.7/src/pymain.cpp +0 -284
  101. pystackreg-0.2.7/src/test_TurboReg.cpp +0 -121
  102. pystackreg-0.2.7/tox.ini +0 -15
  103. {pystackreg-0.2.7 → pystackreg-0.3.0}/docs/Makefile +0 -0
  104. {pystackreg-0.2.7 → pystackreg-0.3.0}/docs/authors.rst +0 -0
  105. {pystackreg-0.2.7 → pystackreg-0.3.0}/docs/changelog.rst +0 -0
  106. {pystackreg-0.2.7 → pystackreg-0.3.0}/docs/make.bat +0 -0
  107. {pystackreg-0.2.7 → pystackreg-0.3.0}/docs/readme.rst +0 -0
  108. {pystackreg-0.2.7 → pystackreg-0.3.0}/docs/reference/index.rst +0 -0
  109. {pystackreg-0.2.7 → pystackreg-0.3.0}/examples/data/imagej-perform-stackreg.ijm +0 -0
  110. {pystackreg-0.2.7 → pystackreg-0.3.0}/examples/data/imagej-perform-turboreg-bilinear.ijm +0 -0
  111. {pystackreg-0.2.7 → pystackreg-0.3.0}/examples/data/pc12-reg-affine.tif +0 -0
  112. {pystackreg-0.2.7 → pystackreg-0.3.0}/examples/data/pc12-reg-bilinear.tif +0 -0
  113. {pystackreg-0.2.7 → pystackreg-0.3.0}/examples/data/pc12-reg-rigid-body.tif +0 -0
  114. {pystackreg-0.2.7 → pystackreg-0.3.0}/examples/data/pc12-reg-scaled-rotation.tif +0 -0
  115. {pystackreg-0.2.7 → pystackreg-0.3.0}/examples/data/pc12-reg-translation.tif +0 -0
  116. {pystackreg-0.2.7 → pystackreg-0.3.0}/examples/data/pc12-unreg.tif +0 -0
  117. {pystackreg-0.2.7 → pystackreg-0.3.0}/pystackreg.egg-info/dependency_links.txt +0 -0
  118. {pystackreg-0.2.7 → pystackreg-0.3.0}/pystackreg.egg-info/top_level.txt +0 -0
  119. {pystackreg-0.2.7 → pystackreg-0.3.0}/setup.cfg +0 -0
@@ -0,0 +1,41 @@
1
+ Authors
2
+ =======
3
+
4
+ Original method and software
5
+ ----------------------------
6
+
7
+ * Registration method: Philippe Thévenaz, Urs E. Ruttimann and Michael Unser,
8
+ *A Pyramid Approach to Subpixel Registration Based on Intensity*, IEEE
9
+ Transactions on Image Processing 7(1), 27-41 (1998).
10
+ * Developer of the original ImageJ plugins TurboReg/StackReg: Philippe Thévenaz,
11
+ Biomedical Imaging Group, EPFL (https://bigwww.epfl.ch/thevenaz/)
12
+
13
+ pystackreg
14
+ ----------
15
+
16
+ * Developer and maintainer of this package (port of the Java code from
17
+ P. Thévenaz to C++, Python interface and all further functionality):
18
+ Gregor Lichtner `@glichtner <https://github.com/glichtner>`_
19
+
20
+ Contributors
21
+ ............
22
+
23
+ * Sebastian Oltmanns - progress callback
24
+ (`PR #1 <https://github.com/glichtner/pystackreg/pull/1>`_)
25
+ * Maksim Rakitin - license file in the source distribution
26
+ (`PR #4 <https://github.com/glichtner/pystackreg/pull/4>`_)
27
+ * Florian Rey - installation without a preinstalled NumPy
28
+ (`PR #10 <https://github.com/glichtner/pystackreg/pull/10>`_)
29
+ * Oren Amsalem - ``tqdm.auto`` progress bars, parallel stack registration with
30
+ a process pool, documentation
31
+ (`PR #11 <https://github.com/glichtner/pystackreg/pull/11>`_,
32
+ `PR #16 <https://github.com/glichtner/pystackreg/pull/16>`_,
33
+ `PR #17 <https://github.com/glichtner/pystackreg/pull/17>`_)
34
+ * Patrick Schuenke - fix for the ``axis`` argument with ``reference="mean"``
35
+ (`PR #26 <https://github.com/glichtner/pystackreg/pull/26>`_)
36
+ * `@camilo1729 <https://github.com/camilo1729>`_ - proposal to release the GIL
37
+ in the native code
38
+ (`issue #14 <https://github.com/glichtner/pystackreg/issues/14>`_)
39
+
40
+ Thanks to everyone who reported problems and suggested improvements in the
41
+ `issue tracker <https://github.com/glichtner/pystackreg/issues>`_.
@@ -0,0 +1,179 @@
1
+ Changelog
2
+ =========
3
+
4
+ 0.3.0 (2026-11-21)
5
+ ------------------
6
+
7
+ This release modernizes the package. Apart from the corrections listed below,
8
+ results of registrations and transformations are unchanged: they are verified
9
+ bit for bit against 0.2.8.
10
+
11
+ License
12
+ .......
13
+ - pystackreg is now distributed under the **GNU General Public License,
14
+ version 3 or later**, the license under which TurboReg and StackReg are
15
+ distributed by their author. Versions up to 0.2.8 remain under the terms
16
+ they were published with. See ``NOTICE``.
17
+
18
+ Added
19
+ .....
20
+ - Parallel processing: ``register_stack()``, ``transform_stack()`` and
21
+ ``register_transform_stack()`` accept ``n_jobs`` (number of threads; ``-1``
22
+ uses all CPUs). The native code releases the GIL, so threads are used and no
23
+ data are copied between processes. Parallel results are identical to
24
+ sequential results for all reference modes, including ``"previous"``
25
+ (`issue #14 <https://github.com/glichtner/pystackreg/issues/14>`_,
26
+ `PR #17 <https://github.com/glichtner/pystackreg/pull/17>`_,
27
+ `PR #33 <https://github.com/glichtner/pystackreg/pull/33>`_).
28
+ - ``transform_stack()`` and ``register_transform_stack()`` accept ``out``: a
29
+ preallocated array of another dtype (integer dtypes are rounded and clipped),
30
+ a ``numpy.memmap``, or the input itself for in-place operation
31
+ (`issue #28 <https://github.com/glichtner/pystackreg/issues/28>`_).
32
+ - ``StackReg.transform_points()`` applies a transformation to point
33
+ coordinates, also for the bilinear transformation
34
+ (`issue #42 <https://github.com/glichtner/pystackreg/issues/42>`_).
35
+ - ``pystackreg.util.max_displacement()`` measures the amplitude of
36
+ transformations, e.g. to detect implausible registration results
37
+ (`issue #41 <https://github.com/glichtner/pystackreg/issues/41>`_).
38
+ - ``transform_stack()`` accepts ``verbose`` and ``progress_callback``;
39
+ ``register_transform_stack()`` accepts ``suppress_axis_warning``.
40
+ - Type annotations (``py.typed``), support for free-threaded CPython builds.
41
+ - Validation suite; the documentation reports a comparison with the original
42
+ TurboReg.
43
+
44
+ Changed
45
+ .......
46
+ - Python 3.10 or newer is required; Python 3.10 - 3.15 are tested. Wheels are
47
+ built against NumPy 2 and run with NumPy >= 1.22.
48
+ - Memory use of stack functions is much lower
49
+ (`issue #28 <https://github.com/glichtner/pystackreg/issues/28>`_):
50
+ the time-axis check, the moving average and ``transform_stack()`` no longer
51
+ create temporary copies of the whole stack.
52
+ - ``transform()`` is about three times faster (1.6 times for the bilinear
53
+ transformation); it no longer computes image pyramids and gradients that
54
+ only the registration needs. The speed of ``register()`` is unchanged.
55
+ - The check that warns about a wrong ``axis`` is evaluated in chunks.
56
+ - Binary wheels are no longer built for 32-bit platforms (Linux i686,
57
+ Windows win32); wheels for Linux aarch64 and macOS x86-64 are added.
58
+ - Progress bars use ``tqdm.auto`` (terminal or notebook widget,
59
+ `PR #11 <https://github.com/glichtner/pystackreg/pull/11>`_), are labelled,
60
+ and are closed when an error occurs. ``tqdm`` is imported only when
61
+ ``verbose=True``. ``register_transform_stack(verbose=True)`` shows a second
62
+ bar for the transformation.
63
+ - Invalid arguments raise ``ValueError``, ``TypeError`` or ``RuntimeError``
64
+ with specific messages instead of a bare ``Exception`` (all three are
65
+ subclasses of ``Exception``).
66
+ - Images containing NaN or infinite values are rejected by ``register()`` and
67
+ ``register_stack()`` with a ``ValueError``. Previously such images silently
68
+ produced an identity transformation.
69
+ - Images smaller than 3 x 3 pixels, empty stacks, non-finite transformation
70
+ matrices and matrices of the wrong shape are rejected with a ``ValueError``.
71
+ Previously these cases read out-of-bounds memory or crashed.
72
+ - The moving average (``moving_average`` > 1) of floating-point stacks is
73
+ computed in double precision, so results for such stacks can differ in the
74
+ last digits from 0.2.8. Integer stacks are unaffected.
75
+ - Compiled with ``-ffp-contract=off``: results no longer depend on whether
76
+ the CPU architecture fuses multiply-add operations (affects arm64 builds in
77
+ the last bits).
78
+ - Project metadata moved to ``pyproject.toml``; development uses Ruff, mypy
79
+ and pytest.
80
+
81
+ Fixed
82
+ .....
83
+ - ``reference="previous"`` combined with ``moving_average`` > 1 registered
84
+ the first frame against the *last* frame of the stack, which shifted the
85
+ whole registered stack.
86
+ - ``moving_average`` > 1 gave wrong results for ``axis`` other than 0
87
+ (``util.running_mean()`` ignored the axis when taking differences).
88
+ - Memory leak in the extension module: every call to ``register()`` leaked
89
+ the three returned arrays (about 430 bytes).
90
+ - Crash (NULL pointer dereference) when an image could not be converted to
91
+ floating point, e.g. for complex data.
92
+ - Out-of-bounds reads for images with a side of one or two pixels.
93
+ - Undefined behavior (float-to-int conversion of NaN/out-of-range values) in
94
+ the registration of constant images and in ``transform()`` with extreme
95
+ matrices; conversions now follow the semantics of the Java original.
96
+ - ``get_matrix()`` before a registration raised an unrelated ``TypeError``.
97
+ - Images with a side shorter than 24 pixels were not registered reliably with
98
+ the scaled-rotation and affine transformations: the registration used a
99
+ value that was never set, so the result depended on the contents of memory
100
+ and was usually the identity. Such images are now registered. This differs
101
+ from TurboReg, which returns the identity in this case; results for larger
102
+ images are unchanged.
103
+
104
+ Removed
105
+ .......
106
+ - Support for Python < 3.10 and the Python 2 code paths of the extension.
107
+ - ``pystackreg/conftest.py`` is no longer installed with the package.
108
+
109
+ 0.2.8
110
+ -----
111
+
112
+ Fixed
113
+ .....
114
+ - Add NumPy 2 support
115
+
116
+ 0.2.7
117
+ -----
118
+
119
+ Fixed
120
+ .....
121
+ - Axis argument not used for method "mean" in register_stack() (`PR #26 <https://github.com/glichtner/pystackreg/pull/26>`_)
122
+
123
+ 0.2.6
124
+ -----
125
+
126
+ Added
127
+ .....
128
+ - Exposing `simple_slice` and `running_mean` functions in the util package
129
+ - Added conversion function to any integer dtype
130
+
131
+ 0.2.5
132
+ -----
133
+
134
+ Fixed
135
+ .....
136
+ - Compilation in environments without NumPy
137
+
138
+ 0.2.3
139
+ -----
140
+
141
+ Added
142
+ .....
143
+ - Added example data and tutorial notebook
144
+ - Added unit tests
145
+ - Additional documentation
146
+ - Detection of time series axis in stacks – will raise a warning if supplied axis in stack registration does not correspond to the detected axis
147
+
148
+ Changed
149
+ .....~~
150
+ - `progress_callback` function now gets called with the iteration number, not the iteration index (iteration number = iteration index + 1)
151
+
152
+ Fixed
153
+ .....
154
+ - Fixed exception when using a different axis than 0 for registering stacks
155
+
156
+ 0.2.2
157
+ -----
158
+
159
+ Changed
160
+ .....~~
161
+ - License changed to allow distribution on Python package repositories
162
+
163
+ 0.2.1
164
+ -----
165
+
166
+ Added
167
+ .....
168
+ - Progress callback function can be supplied to `register_stack()` and `register_transform_stack()` functions via the `progress_callback` parameter. It is called after every iteration (i.e., after each image registration).
169
+
170
+ Changed
171
+ .....~~
172
+ - Progress bar output is not shown by default, has to be enabled by using the `verbose=True` parameter in the `register_stack()` and `register_transform_stack()` functions
173
+
174
+ 0.2.0
175
+ -----
176
+
177
+ Added
178
+ .....
179
+ - Bilinear transformation
@@ -0,0 +1,58 @@
1
+ cff-version: 1.2.0
2
+ title: "pystackreg"
3
+ message: >-
4
+ If you use pystackreg, please cite the methods paper by Thévenaz, Ruttimann
5
+ and Unser (1998) listed under "preferred-citation", as requested by the
6
+ authors of the original TurboReg software, and the pystackreg software
7
+ itself (this record).
8
+ type: software
9
+ authors:
10
+ - family-names: Lichtner
11
+ given-names: Gregor
12
+ abstract: >-
13
+ pystackreg is a Python/C++ port of the ImageJ plugins TurboReg and StackReg
14
+ by Philippe Thévenaz (EPFL) for intensity-based subpixel registration of
15
+ images and image stacks.
16
+ repository-code: "https://github.com/glichtner/pystackreg"
17
+ url: "https://pystackreg.readthedocs.io/"
18
+ license: GPL-3.0-or-later
19
+ keywords:
20
+ - image registration
21
+ - image alignment
22
+ - motion correction
23
+ - microscopy
24
+ - TurboReg
25
+ - StackReg
26
+ preferred-citation:
27
+ type: article
28
+ title: "A Pyramid Approach to Subpixel Registration Based on Intensity"
29
+ authors:
30
+ - family-names: Thévenaz
31
+ given-names: Philippe
32
+ - family-names: Ruttimann
33
+ given-names: Urs E.
34
+ - family-names: Unser
35
+ given-names: Michael
36
+ journal: "IEEE Transactions on Image Processing"
37
+ volume: 7
38
+ issue: 1
39
+ start: 27
40
+ end: 41
41
+ year: 1998
42
+ month: 1
43
+ doi: "10.1109/83.650848"
44
+ references:
45
+ - type: software
46
+ title: "TurboReg"
47
+ authors:
48
+ - family-names: Thévenaz
49
+ given-names: Philippe
50
+ url: "https://bigwww.epfl.ch/thevenaz/turboreg/"
51
+ notes: "ImageJ plugin; the software pystackreg is ported from."
52
+ - type: software
53
+ title: "StackReg"
54
+ authors:
55
+ - family-names: Thévenaz
56
+ given-names: Philippe
57
+ url: "https://bigwww.epfl.ch/thevenaz/stackreg/"
58
+ notes: "ImageJ plugin whose stack-registration behaviour pystackreg reproduces."