Pure Python reader for MSR/OBF (Imspector) image data
Project description
msr
Pure Python and cross-platform reader for MSR/OBF image files as created by Imspector.
Implementation follows the description at: https://imspectordocs.readthedocs.io/en/latest/fileformat.html
WARNING: Only tested on data from our own Abberior Expert Line STED microscope with a narrow range of Imspector versions.
Installation
pip install msr-reader
Usage
from msr_reader import OBFFile
from xml.etree import ElementTree
import ome_types
with OBFFile('file_path.msr') as f:
# reading image data
idx = 0
img = f.read_stack(idx) # read stack with index idx into numpy array
# metadata
stack_shapes = f.shapes # list of stack shapes, including stack and dimension names
pixel_sizes = f.pixel_sizes # like shapes, but with pixel sizes (unit: meters)
# imspector metadata as xml string
xml_imspector_metadata = f.get_imspector_xml_metadata(idx)
# can be parsed with ElementTree, for example
et = ElementTree.fromstring(xml_imspector_metadata)
# find, e.g. x pixel size in XML
et.find('doc/ExpControl/scan/range/x/psz').text
# OME-XML metadata as xml string
xml_ome_metadata = f.get_ome_xml_metadata()
# can be parsed with ome-types, for example
ome_meta = ome_types.from_xml(xml_ome_metadata)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file msr_reader-0.2.1.tar.gz.
File metadata
- Download URL: msr_reader-0.2.1.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddebc49ac41beb5bbe4254077e17279fd5a0fddd156aacc6aed0598197a133cb
|
|
| MD5 |
472ba8b53e81760e31cc5e43eb9e8707
|
|
| BLAKE2b-256 |
6d195b3beda8fcb6f57ab2af1c9a06f8373267909a41cbe6921e3dd7c55b67fd
|
File details
Details for the file msr_reader-0.2.1-py3-none-any.whl.
File metadata
- Download URL: msr_reader-0.2.1-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f90165275888f83a55eed904bbb34da10f93d81b143231f7ffd5dc69eb240b31
|
|
| MD5 |
722de92f829dfe08e102ce25b88f6eb9
|
|
| BLAKE2b-256 |
53390014d882d7a1102a9535e8ec6eb35e8f0951da3be3c18bfaca735ee1c7e9
|