Skip to main content

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

License:

BSD-3-Clause

Version:

2026.10.15

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]"

See Examples and Documentation 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.10.15

  • Return image data in axes order and shape of mainfile (#2, breaking).

  • Fix image planes lost due to misparsed file names.

  • Fix path traversal in OibFileSystem.saveas_oif.

  • Fix OifFileSystem.open_file reading files outside of dataset.

  • Fix thread-safety of CompoundFile.

  • Raise OifFileError on truncated CompoundFile streams.

  • Fix infinite loop on cyclic sector chains in CompoundFile.

  • Fix OifFile.glob matching.

  • Support line scans.

  • Require tifffile 2026.10.15.

  • Drop support for Python 3.11 and numpy 2.0 (SPEC0).

  • Support Python 3.15.

2026.2.8

  • Fix code review issues.

2026.1.8

  • …

Refer to the CHANGES file for older revisions.

Notes

No specification document is available.

Tested only with files produced on Olympus FV1000 hardware.

Examples

Import functions and classes used in these examples:

>>> from oiffile import CompoundFile, OifFile, SettingsFile, imread, oib2oif

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'

Preview image and metadata stored in an OIF or OIB file from the console:

python -m oiffile test.oif

Metadata

Release files for oiffile 2026.10.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oiffile 2026.10.15
File Size Uploaded
oiffile-2026.10.15.tar.gz 17.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for oiffile 2026.10.15
File Interpreter ABI Platform
oiffile-2026.10.15-py3-none-any.whl Python 3 none any Details

Total release size: 34.9 kB

Release files / oiffile-2026.10.15.tar.gz

Download URL oiffile-2026.10.15.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7321f5d492c02f1f477b0bc6f8323b4171c49ba0e9076b5cb9ffdca6d0902273
BLAKE2b-256 checksum
How to use checksums
95b3d6352f9ace784b44632bbd966a2a75bf5ae2ffe4ad9c176975c27607d527
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / oiffile-2026.10.15-py3-none-any.whl

Download URL oiffile-2026.10.15-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5efda1da86b40554cb9e43f0a8e582fbe87d71c344bc137aae3e036d79c0c31
BLAKE2b-256 checksum
How to use checksums
3c417bbad71e0d2593d799afa22969d3299fb299ff735e5cb52e784949cefbdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page