From c966c36777d4974a93257f03e49046d4b300e1a8 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Thu, 23 May 2024 19:23:56 +0000 Subject: [PATCH] Release v2024.5.24 --- README.rst | 67 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/README.rst b/README.rst index e1caa1e..055b42c 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,6 @@ +.. + This file is generated by setup.py + Read and write ImageJ ROI format ================================ @@ -9,7 +12,7 @@ interest, geometric shapes, paths, text, and whatnot for image overlays. :Author: `Christoph Gohlke `_ :License: BSD 3-Clause -:Version: 2024.3.20 +:Version: 2024.5.24 :DOI: `10.5281/zenodo.6941603 `_ Quickstart @@ -35,14 +38,18 @@ Requirements This revision was tested with the following requirements and dependencies (other versions may work): -- `CPython `_ 3.9.13, 3.10.11, 3.11.8, 3.12.2 +- `CPython `_ 3.9.13, 3.10.11, 3.11.9, 3.12.3 - `Numpy `_ 1.26.4 -- `Tifffile `_ 2024.2.12 (optional) -- `Matplotlib `_ 3.8.3 (optional) +- `Tifffile `_ 2024.5.22 (optional) +- `Matplotlib `_ 3.8.4 (optional) Revisions --------- +2024.5.24 + +- Fix GitHub not correctly rendering docstring examples. + 2024.3.20 - Fix writing generator of ROIs (#9). @@ -101,37 +108,45 @@ Examples Create a new ImagejRoi instance from an array of x, y coordinates: ->>> roi = ImagejRoi.frompoints([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6]]) ->>> roi.roitype = ROI_TYPE.POINT ->>> roi.options |= ROI_OPTIONS.SHOW_LABELS +.. code-block:: python + + >>> roi = ImagejRoi.frompoints([[1.1, 2.2], [3.3, 4.4], [5.5, 6.6]]) + >>> roi.roitype = ROI_TYPE.POINT + >>> roi.options |= ROI_OPTIONS.SHOW_LABELS Export the instance to an ImageJ ROI formatted byte string or file: ->>> out = roi.tobytes() ->>> out[:4] -b'Iout' ->>> roi.tofile('_test.roi') +.. code-block:: python + + >>> out = roi.tobytes() + >>> out[:4] + b'Iout' + >>> roi.tofile('_test.roi') Read the ImageJ ROI from the file and verify the content: ->>> roi2 = ImagejRoi.fromfile('_test.roi') ->>> roi2 == roi -True ->>> roi.roitype == ROI_TYPE.POINT -True ->>> roi.subpixelresolution -True ->>> roi.coordinates() -array([[1.1, 2.2], - [3.3, 4.4], - [5.5, 6.6]], dtype=float32) ->>> roi.left, roi.top, roi.right, roi.bottom -(1, 2, 7, 8) +.. code-block:: python + + >>> roi2 = ImagejRoi.fromfile('_test.roi') + >>> roi2 == roi + True + >>> roi.roitype == ROI_TYPE.POINT + True + >>> roi.subpixelresolution + True + >>> roi.coordinates() + array([[1.1, 2.2], + [3.3, 4.4], + [5.5, 6.6]], dtype=float32) + >>> roi.left, roi.top, roi.right, roi.bottom + (1, 2, 7, 8) Plot the ROI using matplotlib: ->>> roi.plot() +.. code-block:: python + + >>> roi.plot() View the overlays stored in a ROI, ZIP, or TIFF file from a command line:: - python -m roifile _test.roi + python -m roifile _test.roi \ No newline at end of file