roifile 2024.9.15__py3-none-any.whl → 2025.5.10__py3-none-any.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.

Potentially problematic release.


This version of roifile might be problematic. Click here for more details.

roifile/__init__.py CHANGED
@@ -1,4 +1,17 @@
1
1
  # roifile/__init__.py
2
2
 
3
- from .roifile import __doc__, __all__, __version__
4
3
  from .roifile import *
4
+ from .roifile import __all__, __doc__, __version__
5
+
6
+
7
+ def _set_module() -> None:
8
+ """Set __module__ attribute for all public objects."""
9
+ globs = globals()
10
+ module = globs['__name__']
11
+ for item in __all__:
12
+ obj = globs[item]
13
+ if hasattr(obj, '__module__'):
14
+ obj.__module__ = module
15
+
16
+
17
+ _set_module()
roifile/roifile.py CHANGED
@@ -1,6 +1,6 @@
1
1
  # roifile.py
2
2
 
3
- # Copyright (c) 2020-2024, Christoph Gohlke
3
+ # Copyright (c) 2020-2025, Christoph Gohlke
4
4
  # All rights reserved.
5
5
  #
6
6
  # Redistribution and use in source and binary forms, with or without
@@ -38,8 +38,8 @@ interest, geometric shapes, paths, text, and whatnot for image overlays.
38
38
  .. _ImageJ: https://imagej.net
39
39
 
40
40
  :Author: `Christoph Gohlke <https://www.cgohlke.com>`_
41
- :License: BSD 3-Clause
42
- :Version: 2024.9.15
41
+ :License: BSD-3-Clause
42
+ :Version: 2025.5.10
43
43
  :DOI: `10.5281/zenodo.6941603 <https://doi.org/10.5281/zenodo.6941603>`_
44
44
 
45
45
  Quickstart
@@ -65,14 +65,22 @@ Requirements
65
65
  This revision was tested with the following requirements and dependencies
66
66
  (other versions may work):
67
67
 
68
- - `CPython <https://www.python.org>`_ 3.10.11, 3.11.9, 3.12.5, 3.13.0rc2
69
- - `Numpy <https://pypi.org/project/numpy/>`_ 2.2.1
70
- - `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.8.30 (optional)
71
- - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.9.2 (optional)
68
+ - `CPython <https://www.python.org>`_ 3.10.11, 3.11.9, 3.12.10, 3.13.3 64-bit
69
+ - `NumPy <https://pypi.org/project/numpy/>`_ 2.2.5
70
+ - `Tifffile <https://pypi.org/project/tifffile/>`_ 2025.5.10 (optional)
71
+ - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.10.3 (optional)
72
72
 
73
73
  Revisions
74
74
  ---------
75
75
 
76
+ 2025.5.10
77
+
78
+ - Support Python 3.14.
79
+
80
+ 2025.2.20
81
+
82
+ - Drop support for Python 3.9.
83
+
76
84
  2024.9.15
77
85
 
78
86
  - Improve typing.
@@ -183,6 +191,7 @@ Read the ROIs from the ZIP file:
183
191
 
184
192
  Write the ROIs to an ImageJ formatted TIFF file:
185
193
 
194
+ >>> import numpy
186
195
  >>> import tifffile
187
196
  >>> tifffile.imwrite(
188
197
  ... '_test.tif',
@@ -206,9 +215,10 @@ For an advanced example, see `roifile_demo.py` in the source distribution.
206
215
 
207
216
  from __future__ import annotations
208
217
 
209
- __version__ = '2024.9.15'
218
+ __version__ = '2025.5.10'
210
219
 
211
220
  __all__ = [
221
+ '__version__',
212
222
  'roiread',
213
223
  'roiwrite',
214
224
  'ImagejRoi',
@@ -232,8 +242,8 @@ from typing import TYPE_CHECKING
232
242
  import numpy
233
243
 
234
244
  if TYPE_CHECKING:
235
- from collections.abc import Iterable
236
- from typing import Any, Iterator, Literal
245
+ from collections.abc import Iterable, Iterator
246
+ from typing import Any, Literal
237
247
 
238
248
  from matplotlib.axes import Axes
239
249
  from numpy.typing import ArrayLike, NDArray
@@ -286,6 +296,7 @@ def roiwrite(
286
296
 
287
297
  import zipfile
288
298
 
299
+ assert mode is not None
289
300
  with zipfile.ZipFile(filename, mode) as zf:
290
301
  for r in roi:
291
302
  if name is None:
@@ -750,6 +761,7 @@ class ImagejRoi:
750
761
  mode = 'a' if os.path.exists(filename) else 'w'
751
762
  import zipfile
752
763
 
764
+ assert mode is not None
753
765
  with zipfile.ZipFile(filename, mode) as zf:
754
766
  with zf.open(name, 'w') as fh:
755
767
  fh.write(self.tobytes())
@@ -1096,9 +1108,11 @@ class ImagejRoi:
1096
1108
  multi_coordinates: NDArray[numpy.float32], /
1097
1109
  ) -> list[NDArray[numpy.float32]]:
1098
1110
  """Return list of coordinate arrays from 2D geometric path."""
1099
- coordinates = []
1111
+ coordinates: list[NDArray[numpy.float32]] = []
1100
1112
  points: list[list[float]] = []
1101
- path: list[float] = multi_coordinates.tolist()
1113
+ path: list[float] = []
1114
+
1115
+ path = multi_coordinates.tolist() # type: ignore[assignment]
1102
1116
  n = 0
1103
1117
  m = 0
1104
1118
  while n < len(path):
@@ -1302,8 +1316,8 @@ def enumstr(v: enum.Enum | None, /) -> str:
1302
1316
 
1303
1317
 
1304
1318
  def logger() -> logging.Logger:
1305
- """Return logging.getLogger('roifile')."""
1306
- return logging.getLogger(__name__.replace('roifile.roifile', 'roifile'))
1319
+ """Return logger for roifile module."""
1320
+ return logging.getLogger('roifile')
1307
1321
 
1308
1322
 
1309
1323
  def test(verbose: bool = False) -> None:
@@ -1,16 +1,15 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: roifile
3
- Version: 2024.9.15
3
+ Version: 2025.5.10
4
4
  Summary: Read and write ImageJ ROI format
5
5
  Home-page: https://www.cgohlke.com
6
6
  Author: Christoph Gohlke
7
7
  Author-email: cgohlke@cgohlke.com
8
- License: BSD
8
+ License: BSD-3-Clause
9
9
  Project-URL: Bug Tracker, https://github.com/cgohlke/roifile/issues
10
10
  Project-URL: Source Code, https://github.com/cgohlke/roifile
11
11
  Platform: any
12
12
  Classifier: Development Status :: 4 - Beta
13
- Classifier: License :: OSI Approved :: BSD License
14
13
  Classifier: Intended Audience :: Science/Research
15
14
  Classifier: Intended Audience :: Developers
16
15
  Classifier: Operating System :: OS Independent
@@ -19,13 +18,28 @@ Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
21
20
  Classifier: Programming Language :: Python :: 3.13
22
- Requires-Python: >=3.9
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Requires-Python: >=3.10
23
23
  Description-Content-Type: text/x-rst
24
24
  License-File: LICENSE
25
25
  Requires-Dist: numpy
26
26
  Provides-Extra: all
27
27
  Requires-Dist: matplotlib; extra == "all"
28
28
  Requires-Dist: tifffile; extra == "all"
29
+ Dynamic: author
30
+ Dynamic: author-email
31
+ Dynamic: classifier
32
+ Dynamic: description
33
+ Dynamic: description-content-type
34
+ Dynamic: home-page
35
+ Dynamic: license
36
+ Dynamic: license-file
37
+ Dynamic: platform
38
+ Dynamic: project-url
39
+ Dynamic: provides-extra
40
+ Dynamic: requires-dist
41
+ Dynamic: requires-python
42
+ Dynamic: summary
29
43
 
30
44
  Read and write ImageJ ROI format
31
45
  ================================
@@ -37,8 +51,8 @@ interest, geometric shapes, paths, text, and whatnot for image overlays.
37
51
  .. _ImageJ: https://imagej.net
38
52
 
39
53
  :Author: `Christoph Gohlke <https://www.cgohlke.com>`_
40
- :License: BSD 3-Clause
41
- :Version: 2024.9.15
54
+ :License: BSD-3-Clause
55
+ :Version: 2025.5.10
42
56
  :DOI: `10.5281/zenodo.6941603 <https://doi.org/10.5281/zenodo.6941603>`_
43
57
 
44
58
  Quickstart
@@ -64,14 +78,22 @@ Requirements
64
78
  This revision was tested with the following requirements and dependencies
65
79
  (other versions may work):
66
80
 
67
- - `CPython <https://www.python.org>`_ 3.10.11, 3.11.9, 3.12.5, 3.13.0rc2
68
- - `Numpy <https://pypi.org/project/numpy/>`_ 2.2.1
69
- - `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.8.30 (optional)
70
- - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.9.2 (optional)
81
+ - `CPython <https://www.python.org>`_ 3.10.11, 3.11.9, 3.12.10, 3.13.3 64-bit
82
+ - `NumPy <https://pypi.org/project/numpy/>`_ 2.2.5
83
+ - `Tifffile <https://pypi.org/project/tifffile/>`_ 2025.5.10 (optional)
84
+ - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.10.3 (optional)
71
85
 
72
86
  Revisions
73
87
  ---------
74
88
 
89
+ 2025.5.10
90
+
91
+ - Support Python 3.14.
92
+
93
+ 2025.2.20
94
+
95
+ - Drop support for Python 3.9.
96
+
75
97
  2024.9.15
76
98
 
77
99
  - Improve typing.
@@ -182,6 +204,7 @@ Read the ROIs from the ZIP file:
182
204
 
183
205
  Write the ROIs to an ImageJ formatted TIFF file:
184
206
 
207
+ >>> import numpy
185
208
  >>> import tifffile
186
209
  >>> tifffile.imwrite(
187
210
  ... '_test.tif',
@@ -0,0 +1,10 @@
1
+ roifile/__init__.py,sha256=3rIo0va3lg8nog3pbcWyEbYxGEsxdB9uXUUf3zfTeG4,397
2
+ roifile/__main__.py,sha256=Mfn3wm-4cRRChIRonbEcZZT7eRX6RFlS31S8wS1JAVM,132
3
+ roifile/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ roifile/roifile.py,sha256=DJ9wfD3mw6VscbMBeWQt-bcnp0Gi0X2NqZVQzPeBKIk,48713
5
+ roifile-2025.5.10.dist-info/licenses/LICENSE,sha256=1yXweb-z6uE6JaIRMz2UpNOF-sYNbqTyHYhmRHWjyEI,1559
6
+ roifile-2025.5.10.dist-info/METADATA,sha256=-e_Op2Q0FLIYk-fNnbZK8Xnw0W12iNUJFuenZnPNfvQ,5904
7
+ roifile-2025.5.10.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
8
+ roifile-2025.5.10.dist-info/entry_points.txt,sha256=xP8cwEUbAUeROLXNRanJnAIl13tagbjSSDGfVWf2vh0,49
9
+ roifile-2025.5.10.dist-info/top_level.txt,sha256=QlfLomxPxuYNU0TTR7MXoVBAEAXCj2WJyKvoCJxNwek,8
10
+ roifile-2025.5.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.2)
2
+ Generator: setuptools (80.3.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,6 +1,6 @@
1
- BSD 3-Clause License
1
+ BSD-3-Clause license
2
2
 
3
- Copyright (c) 2020-2024, Christoph Gohlke
3
+ Copyright (c) 2020-2025, Christoph Gohlke
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
@@ -1,10 +0,0 @@
1
- roifile/__init__.py,sha256=leII9J_JWVpi0O9sAnG8s4SpcdwdqEeisFEFsnmN56c,101
2
- roifile/__main__.py,sha256=Mfn3wm-4cRRChIRonbEcZZT7eRX6RFlS31S8wS1JAVM,132
3
- roifile/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- roifile/roifile.py,sha256=4DEDDd_hzjhPdrByjDRBYOEzkcjVvg9X3urOOmvStYI,48478
5
- roifile-2024.9.15.dist-info/LICENSE,sha256=4bDcZTEFGF584Dw8M-07T5qfat7bsrfr8uuffsbFJYU,1559
6
- roifile-2024.9.15.dist-info/METADATA,sha256=_jKO-ffueSPxsvfJ-b2oTOAA99QgkgI8sTdGe_IMi88,5471
7
- roifile-2024.9.15.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
8
- roifile-2024.9.15.dist-info/entry_points.txt,sha256=xP8cwEUbAUeROLXNRanJnAIl13tagbjSSDGfVWf2vh0,49
9
- roifile-2024.9.15.dist-info/top_level.txt,sha256=QlfLomxPxuYNU0TTR7MXoVBAEAXCj2WJyKvoCJxNwek,8
10
- roifile-2024.9.15.dist-info/RECORD,,