Skip to main content

brimfile package

Documentation

What is it?

brimfile is a package to read and write to brim (Brillouin imaging) files, containing spectral data and metadata from Brillouin microscopy.

The detailed specs of the brim file format can be found here.

How to install it

We recommend installing brimfile in a virtual environment.

After activating the environment, brimfile can be installed from PyPI using pip:

pip install brimfile

How to use it

The full documentation of the package can be found here.

To quickly start reading an existing .brim file, the following code shows how to:

  • open a .brim file
  • get an image for the Brillouin shift
  • get the spectrum at a specific pixel
  • get the metadata.
from brimfile import File, Data, Metadata, AnalysisResults
Quantity = AnalysisResults.Quantity
PeakType = AnalysisResults.PeakType

filename = 'path/to/your/file.brim.zarr' 
f = File(filename)

# get the first data group in the file
d = f.get_data()

# get the first analysis results in the data group
ar = d.get_analysis_results()

# get the image for the shift
img, px_size = ar.get_image(Quantity.Shift, PeakType.average)

# get the spectrum at the pixel (pz,py,px)
(pz,py,px) = (0,0,0)
PSD, frequency, PSD_units, frequency_units = d.get_spectrum_in_image((pz,py,px))

# get the metadata 
md = d.get_metadata()
all_metadata = md.all_to_dict()

# close the file
f.close()

More examples could be found in the examples folder

Matlab support

You can download the Matlab toolbox, which is basically a wrapper around the Python brimfile package, so you can refer to the same documentation. We only support Matlab >= R2023b, as brimfile needs Python 3.11.

Note that the current version of the Matlab toolbox is not supporting all the functions defined in brimfile and it has not been tested extensively yet.

Metadata

Release files for brimfile 1.7.0

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

Source distribution (sdist)

Source distribution for brimfile 1.7.0
File Size Uploaded
brimfile-1.7.0.tar.gz 189.4 kB Details

Built distribution (wheel)

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

Total release size: 279.3 kB

Release files / brimfile-1.7.0.tar.gz

Download URL brimfile-1.7.0.tar.gz
Size 189.4 kB
Tags Source
SHA-256 checksum
How to use checksums
163f8dc98180dcbff8d23df4a54af74ce28d21377fc36e291b8b8e275f9803e2
BLAKE2b-256 checksum
How to use checksums
5d531daaf5dc381b5ba025826d959b8aa90feab9039fbf0dc4ea5f727c68d236
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.

Transparency log

Release files / brimfile-1.7.0-py3-none-any.whl

Download URL brimfile-1.7.0-py3-none-any.whl
Size 89.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b76f1cdbb3a217cb362c8013516ef43b62f664e6cb4bcaf2b34661b96a3864a
BLAKE2b-256 checksum
How to use checksums
55e5253629597a190da4cac7a21f424ea1dd7f5c8d7f33b362a5801d46e0a387
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 16, 2026.

Transparency log

Release history Release notifications | RSS feed

1.7.3

2 release files

1.7.2

2 release files

1.7.1

2 release files

This release

1.7.0 This release

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

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