Skip to main content

Read Olympus image files (OIF and OIB)

Project description

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

License:

BSD-3-Clause

Version:

2026.2.8

DOI:

10.5281/zenodo.17905223

Quickstart

Install the oiffile package and all dependencies from the Python Package Index:

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

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

python -m oiffile file.oif

See Examples for using the programming interface.

Source code and support are available on GitHub.

Requirements

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

Revisions

2026.2.8

  • Fix code review issues.

2026.1.8

  • Improve code quality.

2025.12.12

  • Derive OifFileError from ValueError.

  • Drop support for Python 3.10.

2025.5.10

  • Remove doctest command line option.

  • Support Python 3.14.

2025.1.1

  • Improve type hints.

  • Drop support for Python 3.9, support Python 3.13.

2024.5.24

Refer to the CHANGES file for older revisions.

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:

>>> from tifffile import natural_sorted
>>> 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'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oiffile-2026.2.8.tar.gz (168.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oiffile-2026.2.8-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file oiffile-2026.2.8.tar.gz.

File metadata

  • Download URL: oiffile-2026.2.8.tar.gz
  • Upload date:
  • Size: 168.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for oiffile-2026.2.8.tar.gz
Algorithm Hash digest
SHA256 89c008104fd41a83513e3f8971783b04cc1d6b22290740650b6e1eef51b1c8e2
MD5 cf9db10d9d89e993ea8e1f21787ee133
BLAKE2b-256 53d5b5690dc1900410774870749622eeddbd5c1db1a6f8e33cb16348c9bc8c3a

See more details on using hashes here.

File details

Details for the file oiffile-2026.2.8-py3-none-any.whl.

File metadata

  • Download URL: oiffile-2026.2.8-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for oiffile-2026.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 39cda0c7e15a75fbc847b1e0315f7cda9137cfa3e2f1a036bca17f59a3e3a1bf
MD5 288cebce849b2dae62de678706efd920
BLAKE2b-256 bbdba62b6f6ef79fdde21059737546ed8f801aef70a009bd90e85115abc80b7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page