phasorpy 0.2__cp313-cp313-win_amd64.whl → 0.4__cp313-cp313-win_amd64.whl

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.
phasorpy/plot.py CHANGED
@@ -43,6 +43,7 @@ from ._phasorpy import _intersection_circle_circle, _intersection_circle_line
43
43
  from ._utils import (
44
44
  dilate_coordinates,
45
45
  parse_kwargs,
46
+ parse_signal_axis,
46
47
  phasor_from_polar_scalar,
47
48
  phasor_to_polar_scalar,
48
49
  sort_coordinates,
@@ -171,12 +172,16 @@ class PhasorPlot:
171
172
  @property
172
173
  def fig(self) -> Figure | None:
173
174
  """Matplotlib :py:class:`matplotlib.figure.Figure`."""
174
- return self._ax.get_figure()
175
+ try:
176
+ # matplotlib >= 3.10.0
177
+ return self._ax.get_figure(root=True)
178
+ except TypeError:
179
+ return self._ax.get_figure() # type: ignore[return-value]
175
180
 
176
181
  @property
177
182
  def dataunit_to_point(self) -> float:
178
183
  """Factor to convert data to point unit."""
179
- fig = self._ax.get_figure()
184
+ fig = self.fig
180
185
  assert fig is not None
181
186
  length = fig.bbox_inches.height * self._ax.get_position().height * 72.0
182
187
  vrange: float = numpy.diff(self._ax.get_ylim()).item()
@@ -213,7 +218,7 @@ class PhasorPlot:
213
218
  /,
214
219
  fmt: str = 'o',
215
220
  *,
216
- label: str | Sequence[str] | None = None,
221
+ label: Sequence[str] | None = None,
217
222
  **kwargs: Any,
218
223
  ) -> list[Line2D]:
219
224
  """Plot imag versus real coordinates as markers and/or lines.
@@ -228,7 +233,7 @@ class PhasorPlot:
228
233
  Must be of same shape as `real`.
229
234
  fmt : str, optional, default: 'o'
230
235
  Matplotlib style format string.
231
- label : str or sequence of str, optional
236
+ label : sequence of str, optional
232
237
  Plot label.
233
238
  May be a sequence if phasor coordinates are two dimensional arrays.
234
239
  **kwargs
@@ -1854,7 +1859,7 @@ def plot_signal_image(
1854
1859
  signal: ArrayLike,
1855
1860
  /,
1856
1861
  *,
1857
- axis: int | None = None,
1862
+ axis: int | str | None = None,
1858
1863
  percentile: float | Sequence[float] | None = None,
1859
1864
  title: str | None = None,
1860
1865
  show: bool = True,
@@ -1872,9 +1877,10 @@ def plot_signal_image(
1872
1877
  ----------
1873
1878
  signal : array_like
1874
1879
  Image stack. Must be three or more dimensional.
1875
- axis : int, optional, default: -1
1880
+ axis : int or str, optional
1876
1881
  Axis over which phasor coordinates would be computed.
1877
- The default is the last axis (-1).
1882
+ By default, the 'H' or 'C' axes if signal contains such dimension
1883
+ names, else the last axis (-1).
1878
1884
  percentile : float or [float, float], optional
1879
1885
  The [q, 100-q] percentiles of image data are covered by colormaps.
1880
1886
  By default, the complete value range of `mean` is covered,
@@ -1895,13 +1901,22 @@ def plot_signal_image(
1895
1901
  """
1896
1902
  # TODO: add option to separate channels?
1897
1903
  # TODO: add option to plot non-images?
1904
+
1905
+ axis, axis_label = parse_signal_axis(signal, axis)
1906
+ if (
1907
+ axis_label
1908
+ and hasattr(signal, 'coords')
1909
+ and axis_label in signal.coords
1910
+ ):
1911
+ axis_coords = signal.coords[axis_label]
1912
+ else:
1913
+ axis_coords = None
1914
+
1898
1915
  update_kwargs(kwargs, interpolation='nearest')
1899
1916
  signal = numpy.asarray(signal)
1900
1917
  if signal.ndim < 3:
1901
1918
  raise ValueError(f'not an image stack {signal.ndim=} < 3')
1902
1919
 
1903
- if axis is None:
1904
- axis = -1
1905
1920
  axis %= signal.ndim
1906
1921
 
1907
1922
  # for MyPy
@@ -1918,8 +1933,13 @@ def plot_signal_image(
1918
1933
  axes = list(range(signal.ndim))
1919
1934
  del axes[axis]
1920
1935
  ax = fig.add_subplot(gs[0, 1])
1921
- ax.set_title(f'mean, axis {axis}')
1922
- ax.plot(numpy.nanmean(signal, axis=tuple(axes)))
1936
+
1937
+ if axis_coords is not None:
1938
+ ax.set_title(f'{axis=} {axis_label!r}')
1939
+ ax.plot(axis_coords, numpy.nanmean(signal, axis=tuple(axes)))
1940
+ else:
1941
+ ax.set_title(f'{axis=}')
1942
+ ax.plot(numpy.nanmean(signal, axis=tuple(axes)))
1923
1943
 
1924
1944
  # image
1925
1945
  axes = list(sorted(axes[:-2] + [axis]))
phasorpy/version.py CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- __version__ = '0.2'
5
+ __version__ = '0.4'
6
6
 
7
7
 
8
8
  def versions(
@@ -44,6 +44,7 @@ def versions(
44
44
  'lfdfiles',
45
45
  'sdtfile',
46
46
  'ptufile',
47
+ 'liffile',
47
48
  'matplotlib',
48
49
  'scipy',
49
50
  'skimage',
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022-2024 PhasorPy Contributors
3
+ Copyright (c) 2022-2025 PhasorPy Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: phasorpy
3
- Version: 0.2
3
+ Version: 0.4
4
4
  Summary: Analysis of fluorescence lifetime and hyperspectral images using the phasor approach
5
5
  Author: PhasorPy Contributors
6
6
  License: MIT
@@ -52,6 +52,7 @@ Provides-Extra: all
52
52
  Requires-Dist: lfdfiles>=2024.5.24; extra == "all"
53
53
  Requires-Dist: sdtfile>=2024.5.24; extra == "all"
54
54
  Requires-Dist: ptufile>=2024.9.14; extra == "all"
55
+ Requires-Dist: liffile>=2025.1.30; extra == "all"
55
56
 
56
57
  # PhasorPy
57
58
 
@@ -61,7 +62,7 @@ lifetime and hyperspectral images using the phasor approach.
61
62
  - [Homepage](https://www.phasorpy.org)
62
63
  - [Documentation](https://www.phasorpy.org/docs/stable/)
63
64
  - [Source code](https://github.com/phasorpy/phasorpy)
64
- - [Download releases](https://pypi.org/project/phasorpy/#files)
65
+ - [Install with pip](https://pypi.org/project/phasorpy/) or [conda](https://anaconda.org/conda-forge/phasorpy).
65
66
  - [Data files](https://zenodo.org/communities/phasorpy/)
66
67
  - [Issues and questions](https://github.com/phasorpy/phasorpy/issues)
67
68
 
@@ -0,0 +1,25 @@
1
+ phasorpy/__init__.py,sha256=SwOTreV7wd8ZEL3waXQlgbNnsErWJ0dh6A2d77DWp0Y,254
2
+ phasorpy/__main__.py,sha256=0u6C98HYfajV1RoUww8kAc0CxdsON0ijgEyTYExCSLM,149
3
+ phasorpy/_io.py,sha256=m_GbMezQSOpaDSq_ZY3OtanDKnK7o7HIQUPjcfw5C3c,79239
4
+ phasorpy/_phasorpy.cp313-win_amd64.pyd,sha256=oGjyEpofLRMQNBKp9RkXdFkzztmxYgFeGfmQjWNdZwg,949760
5
+ phasorpy/_phasorpy.pyx,sha256=ukl9_qjzWy-YqnCSZj9ErMohxIObh1JG7U7U25sL-jE,63909
6
+ phasorpy/_typing.py,sha256=ii-5-8KTs2BZq0Ytu3yJl8ejSQj1V06c1_Jcwa_2Snk,1324
7
+ phasorpy/_utils.py,sha256=33KkcMssK9xnQRQMWQ5L9do4I5093FdpNrgLdRmUc7I,15128
8
+ phasorpy/cli.py,sha256=orN_31JOTzIUEfySwTo_Kr24UUzPKdA-DkemsmM8IHk,1977
9
+ phasorpy/color.py,sha256=vb0Vet_BSMz1El3aQeQWpXm-hRcARnx0qRdOUK3OkvI,17264
10
+ phasorpy/components.py,sha256=0ZuUaJllf4c2UFbiTOse5PYXkMLNF8q5VSUxvSgPjy8,10415
11
+ phasorpy/conftest.py,sha256=BywY24LnrOhaTHZIYkVAQ09JmvKZXevNKoshdLeL9nA,949
12
+ phasorpy/cursors.py,sha256=sUZ-9PJ5faJLWewRuENhF7nRJ-drPtW8Ui8YWD6UOw4,15546
13
+ phasorpy/datasets.py,sha256=PZqzvwWw18I8yYzDSG7ehRzXYoxbm9zedYscyaALzUI,18679
14
+ phasorpy/io.py,sha256=LbvRCZrn8A4ttUthTb7OYbKmYGl2c4uiGCX98ZOz494,164
15
+ phasorpy/phasor.py,sha256=FN-98HU3kMaAfHTSos2X462qn0q6GTLQWf2jNILArdU,113485
16
+ phasorpy/plot.py,sha256=M3amG2LeC5cqFyW7er-7Lqi5ZeVpnMLQXqo6fqNICr0,70431
17
+ phasorpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
+ phasorpy/utils.py,sha256=an_dOCZM9WCNUxI3GFuxdjrF8BRVQIc0OnQStgiXF7A,11675
19
+ phasorpy/version.py,sha256=NjmVRZIUgPJtVP7pRSDzkQUzunBbApGY1YefTbIuDzs,1820
20
+ phasorpy-0.4.dist-info/LICENSE.txt,sha256=KVzeDa0MBRSUYPFFNuo7Atn6v62TiJTgGzHigltEX0o,1104
21
+ phasorpy-0.4.dist-info/METADATA,sha256=_DzagbItN_FIcE0rahtlAp1IXIx1TyCCd5WoH5eJdf0,3563
22
+ phasorpy-0.4.dist-info/WHEEL,sha256=6bXTkCllrWLYPW3gCPkeRA91N4604g9hqNhQqZWsUzQ,101
23
+ phasorpy-0.4.dist-info/entry_points.txt,sha256=VRhsl3qGiIKwtMraKapmduchTMbdReUi1AoVTe9f3ss,47
24
+ phasorpy-0.4.dist-info/top_level.txt,sha256=4Y0uYzya5R2loleAxZ6s2n53_FysUbgFTfFaU0i9rbo,9
25
+ phasorpy-0.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp313-cp313-win_amd64
5
5
 
@@ -1,24 +0,0 @@
1
- phasorpy/__init__.py,sha256=SwOTreV7wd8ZEL3waXQlgbNnsErWJ0dh6A2d77DWp0Y,254
2
- phasorpy/__main__.py,sha256=0u6C98HYfajV1RoUww8kAc0CxdsON0ijgEyTYExCSLM,149
3
- phasorpy/_phasorpy.cp313-win_amd64.pyd,sha256=JxyniIPgGzql_Zoi320k1SGJ76MUYIKNGr-nmtP2VuA,884224
4
- phasorpy/_phasorpy.pyx,sha256=MYThk_WpOtiER3fetO5YbvT8f22l4L697WsZ4zqrz54,61361
5
- phasorpy/_typing.py,sha256=ii-5-8KTs2BZq0Ytu3yJl8ejSQj1V06c1_Jcwa_2Snk,1324
6
- phasorpy/_utils.py,sha256=0c3d8D69wG7mTUzc-qh4GDff64FXJK9vFzRrZ0-XOqw,13255
7
- phasorpy/cli.py,sha256=orN_31JOTzIUEfySwTo_Kr24UUzPKdA-DkemsmM8IHk,1977
8
- phasorpy/color.py,sha256=axzL2b0d_g_6pG1wgHSdbiNtn7wAooYl3t-zaUNOBTE,17313
9
- phasorpy/components.py,sha256=0ZuUaJllf4c2UFbiTOse5PYXkMLNF8q5VSUxvSgPjy8,10415
10
- phasorpy/conftest.py,sha256=BywY24LnrOhaTHZIYkVAQ09JmvKZXevNKoshdLeL9nA,949
11
- phasorpy/cursors.py,sha256=sUZ-9PJ5faJLWewRuENhF7nRJ-drPtW8Ui8YWD6UOw4,15546
12
- phasorpy/datasets.py,sha256=AvZcR9hVgW5m7blKt51tFPC7zd1HBJ46GjfCeBb2r9E,15523
13
- phasorpy/io.py,sha256=UGNsRJwzKQCxwilgHC6WYKH_jU97mEJhmC_X3ERoLmw,54103
14
- phasorpy/phasor.py,sha256=Zb3TD6yCLXskCoPSZtSAWeUl1SF0yUKU7pXnVYzJRwI,108671
15
- phasorpy/plot.py,sha256=NfIEn_QynSMNTQGvDrSU6UsIgz15A43VcCLRfsLtnMk,69810
16
- phasorpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
- phasorpy/utils.py,sha256=an_dOCZM9WCNUxI3GFuxdjrF8BRVQIc0OnQStgiXF7A,11675
18
- phasorpy/version.py,sha256=O9DsCV_S63GinqqT6KqrDH1NVV-e0GITROCioK300Pg,1800
19
- phasorpy-0.2.dist-info/LICENSE.txt,sha256=bxzmxrql9vHNenjAb0m7dSkLbEQJW9zJi2E0WjkAI68,1104
20
- phasorpy-0.2.dist-info/METADATA,sha256=DnwjIXBKU4CtRl1VOr0laS0nhsqfSXGeajgvRMdrKW0,3464
21
- phasorpy-0.2.dist-info/WHEEL,sha256=4-iQBlRoDdX1wfPofc7KLWa5Cys4eZSgXs6GVU8fKlQ,101
22
- phasorpy-0.2.dist-info/entry_points.txt,sha256=VRhsl3qGiIKwtMraKapmduchTMbdReUi1AoVTe9f3ss,47
23
- phasorpy-0.2.dist-info/top_level.txt,sha256=4Y0uYzya5R2loleAxZ6s2n53_FysUbgFTfFaU0i9rbo,9
24
- phasorpy-0.2.dist-info/RECORD,,