brukerapi-python
A Python package providing I/O interface for Bruker data sets.
tl;dr
Install using pip:
pip install brukerapi
Load any data set:
from brukerapi.dataset import Dataset
dataset = Dataset('{path}/2dseq') # also supports fid, fid_proc.64, traj, and rawdata.jobN
dataset.data # access data array
dataset.get_value('VisuCoreSize') # get a parameter value
Load an entire study:
from brukerapi.folders import Study
study = Study('{path_to_study_folder}')
dataset = study.get_dataset(exp_id='1', proc_id='1')
dataset.data # Study loads datasets by default
Load a parametric file:
from brukerapi.jcampdx import JCAMPDX
parameters = JCAMPDX('path_to_scan/method')
TR = parameters.params["PVM_RepetitionTime"].value
TR = parameters.get_value("PVM_RepetitionTime")
Features
I/O interface for fid data sets
I/O interface for 2dseq data sets
I/O interface for rawdata data sets
Random access for fid and 2dseq data sets
Split operation implemented over 2dseq data sets
Filter operation implemented over Bruker folders (allowing you to work with a subset of your study only)
ParaVision 5.1, 6.0.1, 7.0.0, and 360 metadata and binary-layout support
Metadata-based fallback inference for custom Cartesian, EPI, radial/UTE, spiral, ZTE, CSI, and spectroscopy sequences
Examples
How to read a Bruker fid, 2dseq, or rawdata file
How to split slice packages of a 2dseq data set
How to split FG_ECHO of a 2dseq data set
How to split FG_ISA of a 2dseq data set
Documentation
Online documentation of the API is available at Read The Docs.
Install
Using pip:
pip install brukerapi
From source:
git clone https://github.com/isi-nmr/brukerapi-python.git
cd brukerapi-python
python -m pip install -e .[dev]
Testing
To ensure reliability, every commit to this repository is tested against the following, publicly available data sets:
BrukerAPI test data set for ParaVision v7.0.0 (Zenodo DOI collection 10.5281/zenodo.4522220)
The corpus download is opt-in for local runs:
python -m pytest test --download_test_data
Without that flag, pytest uses any corpus already present under test/test_data and skips unavailable collections.
File format reference
Bruker ParaVision Raw Data Format is the source of truth for file-format parsing, binary layouts, dataset typing, and metadata-driven acquisition scheme inference in this project.
Compatibility
Tested releases are ParaVision 5.1, 6.0.1, 7.0.0, and PV360 3.x. Supported primary binaries are fid, fid_proc.64, 2dseq, traj, rawdata.jobN, and rawdata.Navigator. Known fid.spiral, fid.navFid, and fid.orig files are exposed as auxiliary subdatasets of their parent fid; they are not accepted as standalone primary datasets. TopSpin/NMR ser is intentionally unsupported.
Known pulse-program names use dedicated layouts. For custom sequences the reader also infers common acquisition families from metadata; callers can pass scheme_id= when inference is ambiguous. Rawdata is returned as complex ordered samples, not as reconstructed k-space. See the compatibility page in the documentation for behavior and current reconstruction limitations.
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 brukerapi-0.3.0.tar.gz.
File metadata
- Download URL: brukerapi-0.3.0.tar.gz
- Upload date:
- Size: 56.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49dd1c50653786a4af22696e103b7b934f53758ce2603fd438acdfc65b0ae60b
|
|
| MD5 |
9aee853ee667b47a194ef1d118001bdb
|
|
| BLAKE2b-256 |
9ec892403cb163a4f5c30a81ff4162e2961bbf9e59314de98591ec8d12984137
|
File details
Details for the file brukerapi-0.3.0-py3-none-any.whl.
File metadata
- Download URL: brukerapi-0.3.0-py3-none-any.whl
- Upload date:
- Size: 46.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48380ed7e7fc077d4ca441725c567c6e614c63535c896665bbf1e67608460678
|
|
| MD5 |
44154b0eb3b3bc78819ae2b05adecdd3
|
|
| BLAKE2b-256 |
be6cc9d4017faf779cacb5bc706c9f32538f673c9b52af2e0558ad87a9243425
|