oiffile


Nameoiffile JSON
Version 2024.5.24 PyPI version JSON
download
home_pagehttps://www.cgohlke.com
SummaryRead Olympus image files (OIF and OIB)
upload_time2024-05-25 17:01:28
maintainerNone
docs_urlNone
authorChristoph Gohlke
requires_python>=3.9
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Read Olympus image files (OIF and OIB)
======================================

Oiffile is a Python library to read image and metadata from Olympus Image
Format files. OIF is the native file format of the Olympus FluoView(tm)
software for confocal microscopy.

There are two variants of the format:

- OIF (Olympus Image File) is a multi-file format that includes a main setting
  file (.oif) and an associated directory with data and setting files (.tif,
  .bmp, .txt, .pty, .roi, and .lut).

- OIB (Olympus Image Binary) is a compound document file, storing OIF and
  associated files within a single file.

:Author: `Christoph Gohlke <https://www.cgohlke.com>`_
:License: BSD 3-Clause
:Version: 2024.5.24

Quickstart
----------

Install the oiffile package and all dependencies from the
`Python Package Index <https://pypi.org/project/oiffile/>`_::

    python -m pip install -U "oiffile[all]"

View image and metadata stored in a OIF or OIB file::

    python -m oiffile file.oif

See `Examples`_ for using the programming interface.

Source code and support are available on
`GitHub <https://github.com/cgohlke/oiffile>`_.

Requirements
------------

This revision was tested with the following requirements and dependencies
(other versions may work):

- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.9, 3.12.3, 64-bit
- `NumPy <https://pypi.org/project/numpy/>`_ 1.26.4
- `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.5.22

Revisions
---------

2024.5.24

- Support NumPy 2.
- Fix docstring examples not correctly rendered on GitHub.

2023.8.30

- Fix linting issues.
- Add py.typed marker.
- Drop support for Python 3.8 and numpy < 1.22 (NEP29).

2022.9.29

- Switch to Google style docstrings.

2022.2.2

- Add type hints.
- Add main function.
- Add FileSystemAbc abstract base class.
- Remove OifFile.tiffs (breaking).
- Drop support for Python 3.7 and numpy < 1.19 (NEP29).

2021.6.6

- Fix unclosed file warnings.

2020.9.18

- Remove support for Python 3.6 (NEP 29).
- Support os.PathLike file names.
- Fix unclosed files.

2020.1.18

- Fix indentation error.

2020.1.1

- Support multiple image series.
- Parse shape and dtype from settings file.
- Remove support for Python 2.7 and 3.5.
- Update copyright.

Notes
-----

No specification document is available.

Tested only with files produced on Olympus FV1000 hardware.

Examples
--------

Read the image from an OIB file as numpy array:

>>> image = imread('test.oib')
>>> image.shape
(3, 256, 256)
>>> image[:, 95, 216]
array([820,  50, 436], dtype=uint16)

Read the image from a single TIFF file in an OIB file:

>>> with OifFile('test.oib') as oib:
...     filename = natural_sorted(oib.glob('*.tif'))[0]
...     image = oib.asarray(filename)
...
>>> filename
'Storage00001/s_C001.tif'
>>> print(image[95, 216])
820

Access metadata and the OIB main file:

>>> with OifFile('test.oib') as oib:
...     oib.axes
...     oib.shape
...     oib.dtype
...     dataname = oib.mainfile['File Info']['DataName']
...
'CYX'
(3, 256, 256)
dtype('uint16')
>>> dataname
'Cell 1 mitoEGFP.oib'

Extract the OIB file content to an OIF file and associated data directory:

>>> import tempfile
>>> tempdir = tempfile.mkdtemp()
>>> oib2oif('test.oib', location=tempdir)
Saving ... done.

Read the image from the extracted OIF file:

>>> image = imread(f'{tempdir}/{dataname[:-4]}.oif')
>>> image[:, 95, 216]
array([820,  50, 436], dtype=uint16)

Read OLE compound file and access the 'OibInfo.txt' settings file:

>>> with CompoundFile('test.oib') as com:
...     info = com.open_file('OibInfo.txt')
...     len(com.files())
...
14
>>> info = SettingsFile(info, 'OibInfo.txt')
>>> info['OibSaveInfo']['Version']
'2.0.0.0'

            

Raw data

            {
    "_id": null,
    "home_page": "https://www.cgohlke.com",
    "name": "oiffile",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Christoph Gohlke",
    "author_email": "cgohlke@cgohlke.com",
    "download_url": "https://files.pythonhosted.org/packages/9c/b2/7edc516ee76a03453542e6e7c795d364e64c47eab55e4d24e731744648f4/oiffile-2024.5.24.tar.gz",
    "platform": "any",
    "description": "Read Olympus image files (OIF and OIB)\r\n======================================\r\n\r\nOiffile is a Python library to read image and metadata from Olympus Image\r\nFormat files. OIF is the native file format of the Olympus FluoView(tm)\r\nsoftware for confocal microscopy.\r\n\r\nThere are two variants of the format:\r\n\r\n- OIF (Olympus Image File) is a multi-file format that includes a main setting\r\n  file (.oif) and an associated directory with data and setting files (.tif,\r\n  .bmp, .txt, .pty, .roi, and .lut).\r\n\r\n- OIB (Olympus Image Binary) is a compound document file, storing OIF and\r\n  associated files within a single file.\r\n\r\n:Author: `Christoph Gohlke <https://www.cgohlke.com>`_\r\n:License: BSD 3-Clause\r\n:Version: 2024.5.24\r\n\r\nQuickstart\r\n----------\r\n\r\nInstall the oiffile package and all dependencies from the\r\n`Python Package Index <https://pypi.org/project/oiffile/>`_::\r\n\r\n    python -m pip install -U \"oiffile[all]\"\r\n\r\nView image and metadata stored in a OIF or OIB file::\r\n\r\n    python -m oiffile file.oif\r\n\r\nSee `Examples`_ for using the programming interface.\r\n\r\nSource code and support are available on\r\n`GitHub <https://github.com/cgohlke/oiffile>`_.\r\n\r\nRequirements\r\n------------\r\n\r\nThis revision was tested with the following requirements and dependencies\r\n(other versions may work):\r\n\r\n- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.9, 3.12.3, 64-bit\r\n- `NumPy <https://pypi.org/project/numpy/>`_ 1.26.4\r\n- `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.5.22\r\n\r\nRevisions\r\n---------\r\n\r\n2024.5.24\r\n\r\n- Support NumPy 2.\r\n- Fix docstring examples not correctly rendered on GitHub.\r\n\r\n2023.8.30\r\n\r\n- Fix linting issues.\r\n- Add py.typed marker.\r\n- Drop support for Python 3.8 and numpy < 1.22 (NEP29).\r\n\r\n2022.9.29\r\n\r\n- Switch to Google style docstrings.\r\n\r\n2022.2.2\r\n\r\n- Add type hints.\r\n- Add main function.\r\n- Add FileSystemAbc abstract base class.\r\n- Remove OifFile.tiffs (breaking).\r\n- Drop support for Python 3.7 and numpy < 1.19 (NEP29).\r\n\r\n2021.6.6\r\n\r\n- Fix unclosed file warnings.\r\n\r\n2020.9.18\r\n\r\n- Remove support for Python 3.6 (NEP 29).\r\n- Support os.PathLike file names.\r\n- Fix unclosed files.\r\n\r\n2020.1.18\r\n\r\n- Fix indentation error.\r\n\r\n2020.1.1\r\n\r\n- Support multiple image series.\r\n- Parse shape and dtype from settings file.\r\n- Remove support for Python 2.7 and 3.5.\r\n- Update copyright.\r\n\r\nNotes\r\n-----\r\n\r\nNo specification document is available.\r\n\r\nTested only with files produced on Olympus FV1000 hardware.\r\n\r\nExamples\r\n--------\r\n\r\nRead the image from an OIB file as numpy array:\r\n\r\n>>> image = imread('test.oib')\r\n>>> image.shape\r\n(3, 256, 256)\r\n>>> image[:, 95, 216]\r\narray([820,  50, 436], dtype=uint16)\r\n\r\nRead the image from a single TIFF file in an OIB file:\r\n\r\n>>> with OifFile('test.oib') as oib:\r\n...     filename = natural_sorted(oib.glob('*.tif'))[0]\r\n...     image = oib.asarray(filename)\r\n...\r\n>>> filename\r\n'Storage00001/s_C001.tif'\r\n>>> print(image[95, 216])\r\n820\r\n\r\nAccess metadata and the OIB main file:\r\n\r\n>>> with OifFile('test.oib') as oib:\r\n...     oib.axes\r\n...     oib.shape\r\n...     oib.dtype\r\n...     dataname = oib.mainfile['File Info']['DataName']\r\n...\r\n'CYX'\r\n(3, 256, 256)\r\ndtype('uint16')\r\n>>> dataname\r\n'Cell 1 mitoEGFP.oib'\r\n\r\nExtract the OIB file content to an OIF file and associated data directory:\r\n\r\n>>> import tempfile\r\n>>> tempdir = tempfile.mkdtemp()\r\n>>> oib2oif('test.oib', location=tempdir)\r\nSaving ... done.\r\n\r\nRead the image from the extracted OIF file:\r\n\r\n>>> image = imread(f'{tempdir}/{dataname[:-4]}.oif')\r\n>>> image[:, 95, 216]\r\narray([820,  50, 436], dtype=uint16)\r\n\r\nRead OLE compound file and access the 'OibInfo.txt' settings file:\r\n\r\n>>> with CompoundFile('test.oib') as com:\r\n...     info = com.open_file('OibInfo.txt')\r\n...     len(com.files())\r\n...\r\n14\r\n>>> info = SettingsFile(info, 'OibInfo.txt')\r\n>>> info['OibSaveInfo']['Version']\r\n'2.0.0.0'\r\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Read Olympus image files (OIF and OIB)",
    "version": "2024.5.24",
    "project_urls": {
        "Bug Tracker": "https://github.com/cgohlke/oiffile/issues",
        "Homepage": "https://www.cgohlke.com",
        "Source Code": "https://github.com/cgohlke/oiffile"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "60cb4cf1926d62ff97f2d56b68b55e04837c9cee9818ac4a7afaf3a32b494730",
                "md5": "84322297b9b80af1645731f916d6d02d",
                "sha256": "36d9b0a30eff6ccfc331a07cd9f6943950769e289191e4f01982f60e3e82690a"
            },
            "downloads": -1,
            "filename": "oiffile-2024.5.24-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "84322297b9b80af1645731f916d6d02d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 14942,
            "upload_time": "2024-05-25T17:01:27",
            "upload_time_iso_8601": "2024-05-25T17:01:27.419407Z",
            "url": "https://files.pythonhosted.org/packages/60/cb/4cf1926d62ff97f2d56b68b55e04837c9cee9818ac4a7afaf3a32b494730/oiffile-2024.5.24-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9cb27edc516ee76a03453542e6e7c795d364e64c47eab55e4d24e731744648f4",
                "md5": "b70c6a71394fc19e4a65dc4f407cc503",
                "sha256": "7a57b8c5afbf1a536bbb2581ebab4daba7219a0ae654073bb285c308d988a8ee"
            },
            "downloads": -1,
            "filename": "oiffile-2024.5.24.tar.gz",
            "has_sig": false,
            "md5_digest": "b70c6a71394fc19e4a65dc4f407cc503",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 167590,
            "upload_time": "2024-05-25T17:01:28",
            "upload_time_iso_8601": "2024-05-25T17:01:28.812371Z",
            "url": "https://files.pythonhosted.org/packages/9c/b2/7edc516ee76a03453542e6e7c795d364e64c47eab55e4d24e731744648f4/oiffile-2024.5.24.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-25 17:01:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cgohlke",
    "github_project": "oiffile",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "oiffile"
}
        
Elapsed time: 0.23170s