Skip to main content

Read Imspector object binary format files (OBF and MSR)

Project description

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.6.28

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 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.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

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

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

obffile-2026.6.28.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

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

obffile-2026.6.28-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file obffile-2026.6.28.tar.gz.

File metadata

  • Download URL: obffile-2026.6.28.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for obffile-2026.6.28.tar.gz
Algorithm Hash digest
SHA256 6e114ed2e193f537311cb6b4f5cbec43ed171df6ae3cec6be4783853d7e8ce12
MD5 ecd061ffeeaab729c802ad0fc64d775d
BLAKE2b-256 8ff05783bb268389651240f24c28ef2fedf55308257d96d2591231104bbee77b

See more details on using hashes here.

File details

Details for the file obffile-2026.6.28-py3-none-any.whl.

File metadata

  • Download URL: obffile-2026.6.28-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for obffile-2026.6.28-py3-none-any.whl
Algorithm Hash digest
SHA256 854de253e8f8310937add06107a9b8b8e3a87a96e8641a5867b0a4e3a83414e9
MD5 41f9e4908684c375072ea951676eb2a0
BLAKE2b-256 d07be4b56c426c9c795005db4a95570fbc588ac5ad159823063a18c272ae2552

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