roifile 2024.1.10__py3-none-any.whl → 2024.5.24__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 +31 -27
- {roifile-2024.1.10.dist-info → roifile-2024.5.24.dist-info}/METADATA +15 -22
- roifile-2024.5.24.dist-info/RECORD +10 -0
- {roifile-2024.1.10.dist-info → roifile-2024.5.24.dist-info}/WHEEL +1 -1
- roifile-2024.1.10.dist-info/RECORD +0 -10
- {roifile-2024.1.10.dist-info → roifile-2024.5.24.dist-info}/LICENSE +0 -0
- {roifile-2024.1.10.dist-info → roifile-2024.5.24.dist-info}/entry_points.txt +0 -0
- {roifile-2024.1.10.dist-info → roifile-2024.5.24.dist-info}/top_level.txt +0 -0
roifile/roifile.py
CHANGED
|
@@ -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: 2024.
|
|
42
|
+
:Version: 2024.5.24
|
|
43
43
|
:DOI: `10.5281/zenodo.6941603 <https://doi.org/10.5281/zenodo.6941603>`_
|
|
44
44
|
|
|
45
45
|
Quickstart
|
|
@@ -48,7 +48,7 @@ Quickstart
|
|
|
48
48
|
Install the roifile package and all dependencies from the
|
|
49
49
|
`Python Package Index <https://pypi.org/project/roifile/>`_::
|
|
50
50
|
|
|
51
|
-
python -m pip install -U roifile[all]
|
|
51
|
+
python -m pip install -U "roifile[all]"
|
|
52
52
|
|
|
53
53
|
View overlays stored in a ROI, ZIP, or TIFF file::
|
|
54
54
|
|
|
@@ -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.9.13, 3.10.11, 3.11.
|
|
69
|
-
- `Numpy <https://pypi.org/project/numpy/>`_ 1.26.
|
|
70
|
-
- `Tifffile <https://pypi.org/project/tifffile/>`_
|
|
71
|
-
- `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.
|
|
68
|
+
- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.9, 3.12.3
|
|
69
|
+
- `Numpy <https://pypi.org/project/numpy/>`_ 1.26.4
|
|
70
|
+
- `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.5.22 (optional)
|
|
71
|
+
- `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.4 (optional)
|
|
72
72
|
|
|
73
73
|
Revisions
|
|
74
74
|
---------
|
|
75
75
|
|
|
76
|
+
2024.5.24
|
|
77
|
+
|
|
78
|
+
- Fix GitHub not correctly rendering docstring examples.
|
|
79
|
+
|
|
80
|
+
2024.3.20
|
|
81
|
+
|
|
82
|
+
- Fix writing generator of ROIs (#9).
|
|
83
|
+
|
|
76
84
|
2024.1.10
|
|
77
85
|
|
|
78
86
|
- Support text rotation.
|
|
@@ -102,21 +110,6 @@ Revisions
|
|
|
102
110
|
|
|
103
111
|
2022.7.29
|
|
104
112
|
|
|
105
|
-
- Update metadata.
|
|
106
|
-
|
|
107
|
-
2022.3.18
|
|
108
|
-
|
|
109
|
-
- Fix creating ROIs from float coordinates exceeding int16 range (#7).
|
|
110
|
-
- Fix bottom-right bounds in ImagejRoi.frompoints.
|
|
111
|
-
|
|
112
|
-
2022.2.2
|
|
113
|
-
|
|
114
|
-
- Add type hints.
|
|
115
|
-
- Change ImagejRoi to dataclass.
|
|
116
|
-
- Drop support for Python 3.7 and numpy < 1.19 (NEP29).
|
|
117
|
-
|
|
118
|
-
2021.6.6
|
|
119
|
-
|
|
120
113
|
- …
|
|
121
114
|
|
|
122
115
|
Refer to the CHANGES file for older revisions.
|
|
@@ -181,7 +174,7 @@ View the overlays stored in a ROI, ZIP, or TIFF file from a command line::
|
|
|
181
174
|
|
|
182
175
|
from __future__ import annotations
|
|
183
176
|
|
|
184
|
-
__version__ = '2024.
|
|
177
|
+
__version__ = '2024.5.24'
|
|
185
178
|
|
|
186
179
|
__all__ = [
|
|
187
180
|
'roiread',
|
|
@@ -253,14 +246,20 @@ def roiwrite(
|
|
|
253
246
|
if mode is None:
|
|
254
247
|
mode = 'a' if os.path.exists(filename) else 'w'
|
|
255
248
|
|
|
256
|
-
if name is None:
|
|
257
|
-
|
|
258
|
-
|
|
249
|
+
if name is not None:
|
|
250
|
+
if isinstance(name, str):
|
|
251
|
+
raise ValueError("'name' is not an iterable of str")
|
|
252
|
+
name = iter(name)
|
|
259
253
|
|
|
260
254
|
import zipfile
|
|
261
255
|
|
|
262
256
|
with zipfile.ZipFile(filename, mode) as zf:
|
|
263
|
-
for
|
|
257
|
+
for r in roi:
|
|
258
|
+
if name is None:
|
|
259
|
+
n = r.name if r.name else r.autoname
|
|
260
|
+
else:
|
|
261
|
+
n = next(name)
|
|
262
|
+
n = n if n[-4:].lower() == '.roi' else n + '.roi'
|
|
264
263
|
with zf.open(n, 'w') as fh:
|
|
265
264
|
fh.write(r.tobytes())
|
|
266
265
|
return None
|
|
@@ -1272,7 +1271,12 @@ def test(verbose: bool = False) -> None:
|
|
|
1272
1271
|
os.remove('_test.zip')
|
|
1273
1272
|
except OSError:
|
|
1274
1273
|
pass
|
|
1275
|
-
|
|
1274
|
+
|
|
1275
|
+
def roi_iter():
|
|
1276
|
+
# issue #9
|
|
1277
|
+
yield from rois
|
|
1278
|
+
|
|
1279
|
+
roiwrite('_test.zip', roi_iter())
|
|
1276
1280
|
assert roiread('_test.zip') == rois
|
|
1277
1281
|
|
|
1278
1282
|
# verify box_combined
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: roifile
|
|
3
|
-
Version: 2024.
|
|
3
|
+
Version: 2024.5.24
|
|
4
4
|
Summary: Read and write ImageJ ROI format
|
|
5
5
|
Home-page: https://www.cgohlke.com
|
|
6
6
|
Author: Christoph Gohlke
|
|
@@ -38,7 +38,7 @@ interest, geometric shapes, paths, text, and whatnot for image overlays.
|
|
|
38
38
|
|
|
39
39
|
:Author: `Christoph Gohlke <https://www.cgohlke.com>`_
|
|
40
40
|
:License: BSD 3-Clause
|
|
41
|
-
:Version: 2024.
|
|
41
|
+
:Version: 2024.5.24
|
|
42
42
|
:DOI: `10.5281/zenodo.6941603 <https://doi.org/10.5281/zenodo.6941603>`_
|
|
43
43
|
|
|
44
44
|
Quickstart
|
|
@@ -47,7 +47,7 @@ Quickstart
|
|
|
47
47
|
Install the roifile package and all dependencies from the
|
|
48
48
|
`Python Package Index <https://pypi.org/project/roifile/>`_::
|
|
49
49
|
|
|
50
|
-
python -m pip install -U roifile[all]
|
|
50
|
+
python -m pip install -U "roifile[all]"
|
|
51
51
|
|
|
52
52
|
View overlays stored in a ROI, ZIP, or TIFF file::
|
|
53
53
|
|
|
@@ -64,14 +64,22 @@ Requirements
|
|
|
64
64
|
This revision was tested with the following requirements and dependencies
|
|
65
65
|
(other versions may work):
|
|
66
66
|
|
|
67
|
-
- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.
|
|
68
|
-
- `Numpy <https://pypi.org/project/numpy/>`_ 1.26.
|
|
69
|
-
- `Tifffile <https://pypi.org/project/tifffile/>`_
|
|
70
|
-
- `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.
|
|
67
|
+
- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.9, 3.12.3
|
|
68
|
+
- `Numpy <https://pypi.org/project/numpy/>`_ 1.26.4
|
|
69
|
+
- `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.5.22 (optional)
|
|
70
|
+
- `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.4 (optional)
|
|
71
71
|
|
|
72
72
|
Revisions
|
|
73
73
|
---------
|
|
74
74
|
|
|
75
|
+
2024.5.24
|
|
76
|
+
|
|
77
|
+
- Fix GitHub not correctly rendering docstring examples.
|
|
78
|
+
|
|
79
|
+
2024.3.20
|
|
80
|
+
|
|
81
|
+
- Fix writing generator of ROIs (#9).
|
|
82
|
+
|
|
75
83
|
2024.1.10
|
|
76
84
|
|
|
77
85
|
- Support text rotation.
|
|
@@ -101,21 +109,6 @@ Revisions
|
|
|
101
109
|
|
|
102
110
|
2022.7.29
|
|
103
111
|
|
|
104
|
-
- Update metadata.
|
|
105
|
-
|
|
106
|
-
2022.3.18
|
|
107
|
-
|
|
108
|
-
- Fix creating ROIs from float coordinates exceeding int16 range (#7).
|
|
109
|
-
- Fix bottom-right bounds in ImagejRoi.frompoints.
|
|
110
|
-
|
|
111
|
-
2022.2.2
|
|
112
|
-
|
|
113
|
-
- Add type hints.
|
|
114
|
-
- Change ImagejRoi to dataclass.
|
|
115
|
-
- Drop support for Python 3.7 and numpy < 1.19 (NEP29).
|
|
116
|
-
|
|
117
|
-
2021.6.6
|
|
118
|
-
|
|
119
112
|
- …
|
|
120
113
|
|
|
121
114
|
Refer to the CHANGES file for older revisions.
|
|
@@ -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=2SiA7oALORVX0mJC6FfyiHnUxivoU06ptIAp9hmuqrk,47109
|
|
5
|
+
roifile-2024.5.24.dist-info/LICENSE,sha256=4bDcZTEFGF584Dw8M-07T5qfat7bsrfr8uuffsbFJYU,1559
|
|
6
|
+
roifile-2024.5.24.dist-info/METADATA,sha256=GP9Nj1hx9z3W733mHG8GCBIR257HGOunuhOkqGVkmTo,4639
|
|
7
|
+
roifile-2024.5.24.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
8
|
+
roifile-2024.5.24.dist-info/entry_points.txt,sha256=xP8cwEUbAUeROLXNRanJnAIl13tagbjSSDGfVWf2vh0,49
|
|
9
|
+
roifile-2024.5.24.dist-info/top_level.txt,sha256=QlfLomxPxuYNU0TTR7MXoVBAEAXCj2WJyKvoCJxNwek,8
|
|
10
|
+
roifile-2024.5.24.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=51FNFTrwVQUkScLd1mw4Ax3freY52o9-LaGBoEraUZo,47023
|
|
5
|
-
roifile-2024.1.10.dist-info/LICENSE,sha256=4bDcZTEFGF584Dw8M-07T5qfat7bsrfr8uuffsbFJYU,1559
|
|
6
|
-
roifile-2024.1.10.dist-info/METADATA,sha256=FtcQcb3fdgT625voDgKG8ruCn2TpAh2ZR_pk3tbgMd4,4807
|
|
7
|
-
roifile-2024.1.10.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
8
|
-
roifile-2024.1.10.dist-info/entry_points.txt,sha256=xP8cwEUbAUeROLXNRanJnAIl13tagbjSSDGfVWf2vh0,49
|
|
9
|
-
roifile-2024.1.10.dist-info/top_level.txt,sha256=QlfLomxPxuYNU0TTR7MXoVBAEAXCj2WJyKvoCJxNwek,8
|
|
10
|
-
roifile-2024.1.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|