Skip to main content

Bruker API

Project description

brukerapi-python

https://zenodo.org/badge/DOI/10.5281/zenodo.3831320.svg https://github.com/isi-nmr/brukerapi-python/workflows/CI/badge.svg Documentation Status

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')    # create data set, works for fid, 2dseq, rawdata.x, ser
dataset.data                         # access data array
dataset.VisuCoreSize                 # get a value of a single parameter

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')

# get_dataset returns an empty dataset
# in order to load data into the data set, you can either use the context manager:

with dataset as d:
    d.data                         # access data array
    d.VisuCoreSize                 # get a value of a parameter

# or the load function
dataset.load()
dataset.data                       # access data array
dataset.VisuCoreSize               # get a value of a single parameter

Load a parametric file:

from brukerapi.jcampdx import JCAMPDX

parameters = JCAMPDX('path_to_scan/method')

TR = data.params["PVM_RepetitionTime"].value # This way
TR = data.get_value("PVM_RepetitionTime") # Or this way

Features

  • I/O interface for fid data sets

  • I/O interface for 2dseq data sets

  • I/O interface for ser 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)

Examples

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 setup.py build
python setup.py install

Testing

To ensure reliability, every commit to this repository is tested against the following, publicly available data sets:

Compatibility

The API was tested using various data sets obtained by ParaVision 5.1, 6.0.1 and 360. It it is compatible with the following data set types from individual ParaVision versions.

ParaVision v5.1

Compatible data set types:

  • fid

  • 2dseq

  • rawdata.job0

  • rawdata.Navigator

Compatible pulse sequences for fid data sets:

  • FLASH.ppg

  • MGE.ppg

  • MSME.ppg

  • RARE.ppg

  • FAIR_RARE.ppg

  • RAREVTR.ppg

  • RAREst.ppg

  • MDEFT.ppg

  • FISP.ppg

  • FLOWMAP.ppg

  • DtiStandard.ppg

  • EPI.ppg

  • FAIR_EPI.ppg

  • DtiEpi.ppg

  • T1_EPI.ppg

  • T2_EPI.ppg

  • T2S_EPI.ppg

  • SPIRAL.ppg

  • DtiSpiral.ppg

  • UTE.ppg

  • UTE3D.ppg

  • ZTE.ppg

  • CSI.ppg

  • FieldMap.ppg

  • NSPECT.ppg

  • PRESS.ppg

  • STEAM.ppg

  • igFLASH.ppg

ParaVision v6.0.1 and v7.0.0

Compatible data set types:

  • fid

  • 2dseq

  • rawdata.job0

  • rawdata.Navigator

Compatible pulse sequences for fid data sets:

  • FLASH.ppg,

  • FLASHAngio.ppg

  • IgFLASH.ppg

  • MGE.ppg

  • MSME.ppg

  • RARE.ppg

  • FAIR_RARE.ppg

  • RAREVTR.ppg

  • RAREst.ppg

  • MDEFT.ppg

  • FISP.ppg

  • FLOWMAP.ppg

  • DtiStandard.ppg

  • EPI.ppg

  • FAIR_EPI.ppg

  • CASL_EPI.ppg

  • DtiEpi.ppg

  • T1_EPI.ppg

  • T2_EPI.ppg

  • T2S_EPI.ppg

  • SPIRAL.ppg

  • DtiSpiral.ppg

  • UTE.ppg

  • UTE3D.ppg

  • ZTE.ppg

  • CSI.ppg

  • FieldMap.ppg

  • SINGLEPULSE.ppg

  • NSPECT.ppg

  • EPSI.ppg

  • PRESS.ppg

  • STEAM.ppg

  • ISIS.ppg

  • CPMG.ppg

  • RfProfile.ppg

ParaVision 360 v1.1 v3.0-v3.7

Reading rawdata is supported only in a basic form, no reshaping into k-space is supported at the moment. Compatible data set types:

  • 2dseq

  • rawdata.job0

  • rawdata.Navigator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brukerapi-0.2.2.tar.gz (39.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brukerapi-0.2.2-py3-none-any.whl (40.8 kB view details)

Uploaded Python 3

File details

Details for the file brukerapi-0.2.2.tar.gz.

File metadata

  • Download URL: brukerapi-0.2.2.tar.gz
  • Upload date:
  • Size: 39.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for brukerapi-0.2.2.tar.gz
Algorithm Hash digest
SHA256 80211bd49c24dcce5b7337b58c8adc5511a709def3cf641799fef5215552f273
MD5 9eb4b758fbd9d273c7a0360c42b2f698
BLAKE2b-256 ac58055423fb969901a8725ece6bc73f2d0a7cbf1b25f4cb1304dfffa1b2f4ea

See more details on using hashes here.

File details

Details for the file brukerapi-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: brukerapi-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 40.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for brukerapi-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c807b8cd8acccc54855e1df4466716fba64ff15ef1df3bba1a9f36c3e2bb789d
MD5 e967918aa93e91469dfc1570b479e77d
BLAKE2b-256 bdddc2317538993c5823d60093709daff5fe7361781f55a6eb1c169994301313

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page