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

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.4
File Size Uploaded Provenance Actions
brimfile-1.7.4.tar.gz 200.2 kB With provenance Details for brimfile-1.7.4.tar.gz

Built distribution (wheel)

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

Total release size: 291.5 kB

Release files / brimfile-1.7.4.tar.gz

Download URL brimfile-1.7.4.tar.gz
Size 200.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cc457872d8ef3efaf59090b4117df79bd21dbcbd4c570abb1e14defb39bc98d7
BLAKE2b-256 checksum
How to use checksums
b968b48ec4c1c0d2306b5d3ebc9a824f4dad3f48128254fccd7e5bf622c4a8ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

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

Download URL brimfile-1.7.4-py3-none-any.whl
Size 91.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa067132b2e421ee4c428248a6e6c20ecf0a4c9f6c234bbafe23cd4ca24431f5
BLAKE2b-256 checksum
How to use checksums
1907c0b320c9a678cc3e141df81add3ecba6604241d134cb3b0ef67c71df5cbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 19, 2026.

Transparency log

Security for brimfile 1.7.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for brimfile-1.7.4.tar.gz

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 Oct 19, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

1.7.4 This release

2 release files Full provenance

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