Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

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.0rc1
File Size Uploaded
brimfile-1.7.0rc1.tar.gz 180.3 kB Details

Built distribution (wheel)

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

Total release size: 269.0 kB

Release files / brimfile-1.7.0rc1.tar.gz

Download URL brimfile-1.7.0rc1.tar.gz
Size 180.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1988487291a8f66bc1b9007394e0976fb057e680495795547612a835ed620008
BLAKE2b-256 checksum
How to use checksums
3ddc9030c7fab04b8440b53b945fd46ccd88235743cca27d2d946cebf3d9ee79
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 8, 2026.

Transparency log

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

Download URL brimfile-1.7.0rc1-py3-none-any.whl
Size 88.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa6b944fbb349c77c69d313b52776973f583b3262d1e19ec51489963b9cecbc4
BLAKE2b-256 checksum
How to use checksums
c2ac57a3655f081289878ce8cc6b5bbf6a5c65a33c3daebb086ccd0914fd8daa
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 8, 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

1.7.0

2 release files

This release

1.7.0rc1 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