roifile 2024.9.15__py3-none-any.whl → 2025.2.20__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/roifile.py +20 -11
- {roifile-2024.9.15.dist-info → roifile-2025.2.20.dist-info}/LICENSE +1 -1
- {roifile-2024.9.15.dist-info → roifile-2025.2.20.dist-info}/METADATA +25 -8
- roifile-2025.2.20.dist-info/RECORD +10 -0
- {roifile-2024.9.15.dist-info → roifile-2025.2.20.dist-info}/WHEEL +1 -1
- roifile-2024.9.15.dist-info/RECORD +0 -10
- {roifile-2024.9.15.dist-info → roifile-2025.2.20.dist-info}/entry_points.txt +0 -0
- {roifile-2024.9.15.dist-info → roifile-2025.2.20.dist-info}/top_level.txt +0 -0
roifile/roifile.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# roifile.py
|
|
2
2
|
|
|
3
|
-
# Copyright (c) 2020-
|
|
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
|
|
@@ -39,7 +39,7 @@ interest, geometric shapes, paths, text, and whatnot for image overlays.
|
|
|
39
39
|
|
|
40
40
|
:Author: `Christoph Gohlke <https://www.cgohlke.com>`_
|
|
41
41
|
:License: BSD 3-Clause
|
|
42
|
-
:Version:
|
|
42
|
+
:Version: 2025.2.20
|
|
43
43
|
:DOI: `10.5281/zenodo.6941603 <https://doi.org/10.5281/zenodo.6941603>`_
|
|
44
44
|
|
|
45
45
|
Quickstart
|
|
@@ -65,14 +65,18 @@ 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.
|
|
69
|
-
- `
|
|
70
|
-
- `Tifffile <https://pypi.org/project/tifffile/>`_
|
|
71
|
-
- `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.
|
|
68
|
+
- `CPython <https://www.python.org>`_ 3.10.11, 3.11.9, 3.12.9, 3.13.2 64-bit
|
|
69
|
+
- `NumPy <https://pypi.org/project/numpy/>`_ 2.2.3
|
|
70
|
+
- `Tifffile <https://pypi.org/project/tifffile/>`_ 2025.2.18 (optional)
|
|
71
|
+
- `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.10.0 (optional)
|
|
72
72
|
|
|
73
73
|
Revisions
|
|
74
74
|
---------
|
|
75
75
|
|
|
76
|
+
2025.2.20
|
|
77
|
+
|
|
78
|
+
- Drop support for Python 3.9.
|
|
79
|
+
|
|
76
80
|
2024.9.15
|
|
77
81
|
|
|
78
82
|
- Improve typing.
|
|
@@ -206,9 +210,10 @@ For an advanced example, see `roifile_demo.py` in the source distribution.
|
|
|
206
210
|
|
|
207
211
|
from __future__ import annotations
|
|
208
212
|
|
|
209
|
-
__version__ = '
|
|
213
|
+
__version__ = '2025.2.20'
|
|
210
214
|
|
|
211
215
|
__all__ = [
|
|
216
|
+
'__version__',
|
|
212
217
|
'roiread',
|
|
213
218
|
'roiwrite',
|
|
214
219
|
'ImagejRoi',
|
|
@@ -232,8 +237,8 @@ from typing import TYPE_CHECKING
|
|
|
232
237
|
import numpy
|
|
233
238
|
|
|
234
239
|
if TYPE_CHECKING:
|
|
235
|
-
from collections.abc import Iterable
|
|
236
|
-
from typing import Any,
|
|
240
|
+
from collections.abc import Iterable, Iterator
|
|
241
|
+
from typing import Any, Literal
|
|
237
242
|
|
|
238
243
|
from matplotlib.axes import Axes
|
|
239
244
|
from numpy.typing import ArrayLike, NDArray
|
|
@@ -286,6 +291,7 @@ def roiwrite(
|
|
|
286
291
|
|
|
287
292
|
import zipfile
|
|
288
293
|
|
|
294
|
+
assert mode is not None
|
|
289
295
|
with zipfile.ZipFile(filename, mode) as zf:
|
|
290
296
|
for r in roi:
|
|
291
297
|
if name is None:
|
|
@@ -750,6 +756,7 @@ class ImagejRoi:
|
|
|
750
756
|
mode = 'a' if os.path.exists(filename) else 'w'
|
|
751
757
|
import zipfile
|
|
752
758
|
|
|
759
|
+
assert mode is not None
|
|
753
760
|
with zipfile.ZipFile(filename, mode) as zf:
|
|
754
761
|
with zf.open(name, 'w') as fh:
|
|
755
762
|
fh.write(self.tobytes())
|
|
@@ -1096,9 +1103,11 @@ class ImagejRoi:
|
|
|
1096
1103
|
multi_coordinates: NDArray[numpy.float32], /
|
|
1097
1104
|
) -> list[NDArray[numpy.float32]]:
|
|
1098
1105
|
"""Return list of coordinate arrays from 2D geometric path."""
|
|
1099
|
-
coordinates = []
|
|
1106
|
+
coordinates: list[NDArray[numpy.float32]] = []
|
|
1100
1107
|
points: list[list[float]] = []
|
|
1101
|
-
path: list[float] =
|
|
1108
|
+
path: list[float] = []
|
|
1109
|
+
|
|
1110
|
+
path = multi_coordinates.tolist() # type: ignore[assignment]
|
|
1102
1111
|
n = 0
|
|
1103
1112
|
m = 0
|
|
1104
1113
|
while n < len(path):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: roifile
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2025.2.20
|
|
4
4
|
Summary: Read and write ImageJ ROI format
|
|
5
5
|
Home-page: https://www.cgohlke.com
|
|
6
6
|
Author: Christoph Gohlke
|
|
@@ -19,13 +19,26 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
-
Requires-Python: >=3.
|
|
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: platform
|
|
37
|
+
Dynamic: project-url
|
|
38
|
+
Dynamic: provides-extra
|
|
39
|
+
Dynamic: requires-dist
|
|
40
|
+
Dynamic: requires-python
|
|
41
|
+
Dynamic: summary
|
|
29
42
|
|
|
30
43
|
Read and write ImageJ ROI format
|
|
31
44
|
================================
|
|
@@ -38,7 +51,7 @@ interest, geometric shapes, paths, text, and whatnot for image overlays.
|
|
|
38
51
|
|
|
39
52
|
:Author: `Christoph Gohlke <https://www.cgohlke.com>`_
|
|
40
53
|
:License: BSD 3-Clause
|
|
41
|
-
:Version:
|
|
54
|
+
:Version: 2025.2.20
|
|
42
55
|
:DOI: `10.5281/zenodo.6941603 <https://doi.org/10.5281/zenodo.6941603>`_
|
|
43
56
|
|
|
44
57
|
Quickstart
|
|
@@ -64,14 +77,18 @@ Requirements
|
|
|
64
77
|
This revision was tested with the following requirements and dependencies
|
|
65
78
|
(other versions may work):
|
|
66
79
|
|
|
67
|
-
- `CPython <https://www.python.org>`_ 3.10.11, 3.11.9, 3.12.
|
|
68
|
-
- `
|
|
69
|
-
- `Tifffile <https://pypi.org/project/tifffile/>`_
|
|
70
|
-
- `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.
|
|
80
|
+
- `CPython <https://www.python.org>`_ 3.10.11, 3.11.9, 3.12.9, 3.13.2 64-bit
|
|
81
|
+
- `NumPy <https://pypi.org/project/numpy/>`_ 2.2.3
|
|
82
|
+
- `Tifffile <https://pypi.org/project/tifffile/>`_ 2025.2.18 (optional)
|
|
83
|
+
- `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.10.0 (optional)
|
|
71
84
|
|
|
72
85
|
Revisions
|
|
73
86
|
---------
|
|
74
87
|
|
|
88
|
+
2025.2.20
|
|
89
|
+
|
|
90
|
+
- Drop support for Python 3.9.
|
|
91
|
+
|
|
75
92
|
2024.9.15
|
|
76
93
|
|
|
77
94
|
- Improve typing.
|
|
@@ -0,0 +1,10 @@
|
|
|
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=U9D1bDHdB7ouX6lo9gzGp8D3MHqLY7097N5gE-F5UXw,48695
|
|
5
|
+
roifile-2025.2.20.dist-info/LICENSE,sha256=pvGlMPFie0plhEXHX8bbte9oDsxZ-CVKIaDLte36Tdc,1559
|
|
6
|
+
roifile-2025.2.20.dist-info/METADATA,sha256=1OTb7eVe9XvXEukBBvQ2rdLMg2yKoKttQMMClbCgp5A,5814
|
|
7
|
+
roifile-2025.2.20.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
8
|
+
roifile-2025.2.20.dist-info/entry_points.txt,sha256=xP8cwEUbAUeROLXNRanJnAIl13tagbjSSDGfVWf2vh0,49
|
|
9
|
+
roifile-2025.2.20.dist-info/top_level.txt,sha256=QlfLomxPxuYNU0TTR7MXoVBAEAXCj2WJyKvoCJxNwek,8
|
|
10
|
+
roifile-2025.2.20.dist-info/RECORD,,
|
|
@@ -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,,
|
|
File without changes
|
|
File without changes
|