Skip to main content

Read Imspector object binary format files (OBF and MSR)

Obffile is a Python library to read image and metadata from Object Binary Format (OBF) and Measurement Summary Record (MSR) image files. These files are written by Imspector software to store image and metadata from microscopy experiments.

Author:

Christoph Gohlke

License:

BSD-3-Clause

Version:

2026.10.20

DOI:

10.5281/zenodo.18706395

Quickstart

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

python -m pip install -U obffile[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.20

  • Preserve stacks with duplicate names (#1).

2026.10.19

  • Return writable stack arrays (memory-mapped views only in ‘r+’ mode).

  • Return zero-copy view of uncompressed, unchunked memory-mapped stacks.

  • Read and decompress stack data directly into output array.

  • Read flush and chunk position tables in one block.

  • Raise ObfFileError on unsupported compression types.

  • Raise ObfFileError on cyclic stack links.

  • Fix LICENSE file.

2026.6.28

  • Add option to memory-map OBF files.

  • Support Python 3.15.

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

2026.2.20

  • Initial alpha release.

  • …

Notes

This library is in its early stages of development. Large, backwards-incompatible changes may occur between revisions.

Imspector is a software platform for super-resolution and confocal microscopy developed by Abberior Instruments.

The Imspector image file formats (OBF and MSR) are documented at https://imspectordocs.readthedocs.io/en/latest/fileformat.html.

OBF is a little-endian binary format storing named, multidimensional image stacks with metadata. Each file has a magic header (OMAS_BF\n\xff\xff), a format version, an XML description, and a linked list of stack records. Stack data may be uncompressed or zlib-compressed. MSR files embed OBF and add Imspector-specific data such as window layout and hardware configuration. The format is designed for forward and backward compatibility.

This library is not feature-complete. Unsupported features currently include writing or modifying OBF/MSR files, non-OBF based MSR files, reading MSR-specific non-image data (window positions, hardware configuration), and compression types other than zlib.

The library has been tested with a limited number of files only.

Other implementations for reading Imspector image files are msr-reader, obf_support.py, and bio-formats.

Examples

Import functions and classes used in these examples:

>>> from obffile import ObfFile

Read an image stack and metadata from an OBF file:

>>> with ObfFile('tests/data/Test.obf') as obf:
...     assert obf.header.metadata['ome_xml'].startswith('<?xml')
...     for stack in obf.stacks:
...         _ = stack.name, stack.dims, stack.shape, stack.dtype
...     obf.stacks[0].asxarray()
...
<xarray.DataArray 'Abberior STAR RED.Confocal' (T: 18, Z: 2, Y: 339, X: 381)...
array([[[[0, 0, 0, ..., 3, 3, 3],
         [0, 0, 0, ..., 4, 3, 3],
         ...,
         [0, 0, 0, ..., 0, 0, 0],
         [0, 0, 0, ..., 0, 0, 0]]]], shape=(18, 2, 339, 381), dtype=int16)
Coordinates:
    * T        (T) float64 144B 0.0 0.0 0.0 0.0 0.0 0.0 ...
    * Z        (Z) float64 16B 1.25e-07 3.75e-07
    * Y        (Y) float64 3kB 0.0 2e-07 4e-07 ...
    * X        (X) float64 3kB 0.0 2.002e-07 4.003e-07 ...
...

View the image stack and metadata in an OBF file from the console:

$ python -m obffile tests/data/Test.obf

Metadata

Release files for obffile 2026.10.20

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

Source distribution (sdist)

Source distribution for obffile 2026.10.20
File Size Uploaded Provenance
obffile-2026.10.20.tar.gz 30.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 52.2 kB

Release files / obffile-2026.10.20.tar.gz

Download URL obffile-2026.10.20.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a4bc39eb999324d6c222fca4638e2dbde88539d4de484c436997e1a2ba7abebc
BLAKE2b-256 checksum
How to use checksums
2cdbc265ba68e606a773a8158a7abd79ee1e57e0cff5b03bdb7fa9f0d457303e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / obffile-2026.10.20-py3-none-any.whl

Download URL obffile-2026.10.20-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c440da0fa35244c52ac145ae482291b9f302ad0d915ffb949bc7819081ee3e90
BLAKE2b-256 checksum
How to use checksums
0e1cdf949b978d8b27478ff1c71d9a2321901c5e17df3544fab1679d29269235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for obffile 2026.10.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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