roifile 2024.1.10__tar.gz → 2024.3.20__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.

Potentially problematic release.


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

@@ -1,6 +1,10 @@
1
1
  Revisions
2
2
  ---------
3
3
 
4
+ 2024.3.20
5
+
6
+ - Fix writing generator of ROIs (#9).
7
+
4
8
  2024.1.10
5
9
 
6
10
  - Support text rotation.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: roifile
3
- Version: 2024.1.10
3
+ Version: 2024.3.20
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.1.10
41
+ :Version: 2024.3.20
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,18 @@ 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.4, 3.12.1
68
- - `Numpy <https://pypi.org/project/numpy/>`_ 1.26.3
69
- - `Tifffile <https://pypi.org/project/tifffile/>`_ 2023.12.9 (optional)
70
- - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.2 (optional)
67
+ - `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.8, 3.12.2
68
+ - `Numpy <https://pypi.org/project/numpy/>`_ 1.26.4
69
+ - `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.2.12 (optional)
70
+ - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.3 (optional)
71
71
 
72
72
  Revisions
73
73
  ---------
74
74
 
75
+ 2024.3.20
76
+
77
+ - Fix writing generator of ROIs (#9).
78
+
75
79
  2024.1.10
76
80
 
77
81
  - Support text rotation.
@@ -101,21 +105,6 @@ Revisions
101
105
 
102
106
  2022.7.29
103
107
 
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
108
  - …
120
109
 
121
110
  Refer to the CHANGES file for older revisions.
@@ -9,7 +9,7 @@ interest, geometric shapes, paths, text, and whatnot for image overlays.
9
9
 
10
10
  :Author: `Christoph Gohlke <https://www.cgohlke.com>`_
11
11
  :License: BSD 3-Clause
12
- :Version: 2024.1.10
12
+ :Version: 2024.3.20
13
13
  :DOI: `10.5281/zenodo.6941603 <https://doi.org/10.5281/zenodo.6941603>`_
14
14
 
15
15
  Quickstart
@@ -18,7 +18,7 @@ Quickstart
18
18
  Install the roifile package and all dependencies from the
19
19
  `Python Package Index <https://pypi.org/project/roifile/>`_::
20
20
 
21
- python -m pip install -U roifile[all]
21
+ python -m pip install -U "roifile[all]"
22
22
 
23
23
  View overlays stored in a ROI, ZIP, or TIFF file::
24
24
 
@@ -35,14 +35,18 @@ Requirements
35
35
  This revision was tested with the following requirements and dependencies
36
36
  (other versions may work):
37
37
 
38
- - `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.4, 3.12.1
39
- - `Numpy <https://pypi.org/project/numpy/>`_ 1.26.3
40
- - `Tifffile <https://pypi.org/project/tifffile/>`_ 2023.12.9 (optional)
41
- - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.2 (optional)
38
+ - `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.8, 3.12.2
39
+ - `Numpy <https://pypi.org/project/numpy/>`_ 1.26.4
40
+ - `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.2.12 (optional)
41
+ - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.3 (optional)
42
42
 
43
43
  Revisions
44
44
  ---------
45
45
 
46
+ 2024.3.20
47
+
48
+ - Fix writing generator of ROIs (#9).
49
+
46
50
  2024.1.10
47
51
 
48
52
  - Support text rotation.
@@ -72,21 +76,6 @@ Revisions
72
76
 
73
77
  2022.7.29
74
78
 
75
- - Update metadata.
76
-
77
- 2022.3.18
78
-
79
- - Fix creating ROIs from float coordinates exceeding int16 range (#7).
80
- - Fix bottom-right bounds in ImagejRoi.frompoints.
81
-
82
- 2022.2.2
83
-
84
- - Add type hints.
85
- - Change ImagejRoi to dataclass.
86
- - Drop support for Python 3.7 and numpy < 1.19 (NEP29).
87
-
88
- 2021.6.6
89
-
90
79
  - …
91
80
 
92
81
  Refer to the CHANGES file for older revisions.
@@ -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.1.10
42
+ :Version: 2024.3.20
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,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.9.13, 3.10.11, 3.11.4, 3.12.1
69
- - `Numpy <https://pypi.org/project/numpy/>`_ 1.26.3
70
- - `Tifffile <https://pypi.org/project/tifffile/>`_ 2023.12.9 (optional)
71
- - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.2 (optional)
68
+ - `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.8, 3.12.2
69
+ - `Numpy <https://pypi.org/project/numpy/>`_ 1.26.4
70
+ - `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.2.12 (optional)
71
+ - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.3 (optional)
72
72
 
73
73
  Revisions
74
74
  ---------
75
75
 
76
+ 2024.3.20
77
+
78
+ - Fix writing generator of ROIs (#9).
79
+
76
80
  2024.1.10
77
81
 
78
82
  - Support text rotation.
@@ -102,21 +106,6 @@ Revisions
102
106
 
103
107
  2022.7.29
104
108
 
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
109
  - …
121
110
 
122
111
  Refer to the CHANGES file for older revisions.
@@ -181,7 +170,7 @@ View the overlays stored in a ROI, ZIP, or TIFF file from a command line::
181
170
 
182
171
  from __future__ import annotations
183
172
 
184
- __version__ = '2024.1.10'
173
+ __version__ = '2024.3.20'
185
174
 
186
175
  __all__ = [
187
176
  'roiread',
@@ -253,14 +242,20 @@ def roiwrite(
253
242
  if mode is None:
254
243
  mode = 'a' if os.path.exists(filename) else 'w'
255
244
 
256
- if name is None:
257
- name = [r.name if r.name else r.autoname for r in roi]
258
- name = [n if n[-4:].lower() == '.roi' else n + '.roi' for n in name]
245
+ if name is not None:
246
+ if isinstance(name, str):
247
+ raise ValueError("'name' is not an iterable of str")
248
+ name = iter(name)
259
249
 
260
250
  import zipfile
261
251
 
262
252
  with zipfile.ZipFile(filename, mode) as zf:
263
- for n, r in zip(name, roi):
253
+ for r in roi:
254
+ if name is None:
255
+ n = r.name if r.name else r.autoname
256
+ else:
257
+ n = next(name)
258
+ n = n if n[-4:].lower() == '.roi' else n + '.roi'
264
259
  with zf.open(n, 'w') as fh:
265
260
  fh.write(r.tobytes())
266
261
  return None
@@ -1272,7 +1267,12 @@ def test(verbose: bool = False) -> None:
1272
1267
  os.remove('_test.zip')
1273
1268
  except OSError:
1274
1269
  pass
1275
- roiwrite('_test.zip', rois)
1270
+
1271
+ def roi_iter():
1272
+ # issue #9
1273
+ yield from rois
1274
+
1275
+ roiwrite('_test.zip', roi_iter())
1276
1276
  assert roiread('_test.zip') == rois
1277
1277
 
1278
1278
  # verify box_combined
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: roifile
3
- Version: 2024.1.10
3
+ Version: 2024.3.20
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.1.10
41
+ :Version: 2024.3.20
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,18 @@ 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.4, 3.12.1
68
- - `Numpy <https://pypi.org/project/numpy/>`_ 1.26.3
69
- - `Tifffile <https://pypi.org/project/tifffile/>`_ 2023.12.9 (optional)
70
- - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.2 (optional)
67
+ - `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.8, 3.12.2
68
+ - `Numpy <https://pypi.org/project/numpy/>`_ 1.26.4
69
+ - `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.2.12 (optional)
70
+ - `Matplotlib <https://pypi.org/project/matplotlib/>`_ 3.8.3 (optional)
71
71
 
72
72
  Revisions
73
73
  ---------
74
74
 
75
+ 2024.3.20
76
+
77
+ - Fix writing generator of ROIs (#9).
78
+
75
79
  2024.1.10
76
80
 
77
81
  - Support text rotation.
@@ -101,21 +105,6 @@ Revisions
101
105
 
102
106
  2022.7.29
103
107
 
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
108
  - …
120
109
 
121
110
  Refer to the CHANGES file for older revisions.
File without changes
File without changes
File without changes
File without changes
File without changes