A package to read and write to the brim file format, containing spectral data and metadata from Brillouin microscopy
Project description
brimfile package
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.
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 brimfile-1.5.2.tar.gz.
File metadata
- Download URL: brimfile-1.5.2.tar.gz
- Upload date:
- Size: 123.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
928dff1042dfc3169f19802530ad066fd15263d1bf511c654eef93a32633c432
|
|
| MD5 |
020cb35feec26c51d066979e86b11ea4
|
|
| BLAKE2b-256 |
2a417a9bf2e848fac5d4182456b710ca297d8b21b9092ddbd5d463513ffdee38
|
Provenance
The following attestation bundles were made for brimfile-1.5.2.tar.gz:
Publisher:
publish_to_pypi.yml on brillouin-imaging/brimfile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brimfile-1.5.2.tar.gz -
Subject digest:
928dff1042dfc3169f19802530ad066fd15263d1bf511c654eef93a32633c432 - Sigstore transparency entry: 1357219282
- Sigstore integration time:
-
Permalink:
brillouin-imaging/brimfile@dc8ea557d50cffa5f0f86368dd25e82a93f60c0f -
Branch / Tag:
refs/tags/v1.5.2 - Owner: https://github.com/brillouin-imaging
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@dc8ea557d50cffa5f0f86368dd25e82a93f60c0f -
Trigger Event:
push
-
Statement type:
File details
Details for the file brimfile-1.5.2-py3-none-any.whl.
File metadata
- Download URL: brimfile-1.5.2-py3-none-any.whl
- Upload date:
- Size: 68.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5367c0cbf317f3ca498149b410ef4cbcaef94bf4d1ff7c9b71ff77fba4f3c5a0
|
|
| MD5 |
093041d1957b9d56f0a88e365d4112cc
|
|
| BLAKE2b-256 |
709450b7916fa0effd8055ef3654d598a87c5862dab9c3e85d020b4247677304
|
Provenance
The following attestation bundles were made for brimfile-1.5.2-py3-none-any.whl:
Publisher:
publish_to_pypi.yml on brillouin-imaging/brimfile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
brimfile-1.5.2-py3-none-any.whl -
Subject digest:
5367c0cbf317f3ca498149b410ef4cbcaef94bf4d1ff7c9b71ff77fba4f3c5a0 - Sigstore transparency entry: 1357219291
- Sigstore integration time:
-
Permalink:
brillouin-imaging/brimfile@dc8ea557d50cffa5f0f86368dd25e82a93f60c0f -
Branch / Tag:
refs/tags/v1.5.2 - Owner: https://github.com/brillouin-imaging
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_to_pypi.yml@dc8ea557d50cffa5f0f86368dd25e82a93f60c0f -
Trigger Event:
push
-
Statement type: