Giter Site home page Giter Site logo

brukermri's Introduction

brukerMRI

Python module to read in Bruker MRI files (parameter files, raw data, processed data). Reconstruction of the raw data is currently only supported for the FLASH method.

/img/brukerMRI.PNG

Requirements

The python module numpy is required (tested with version 1.6.2). The code itself is designed for python 2.7.

Running the example

  • Copy the files brukerMRI.py, example.py and the folder example_dataset into a directory.
  • Switch to that directory and run the example from the shell using
python example.py

Usage

Installation

Copy the file brukerMRI.py to your working directory or add it to PYTHONPATH.

Loading a MRI experiment

Import the brukerMRI module with the statement

import BrukerMRI as bruker

Bruker Paravision stores the MRI experiments in separate folders, which are consecutively numbered. To load an experiment, specify both the main folder, and the experiment number, e.g.

MainDir = "/opt/data/usr/nmr/exp1/"
ExpNum = 100
Experiment = bruker.ReadExperiment(MainDir, ExpNum)

Experiment is now an instance of the class BrukerData. The most important attributes of that class are listed below.

AttributeTypeDescription
methoddictmethod parameters
acqpdictacquisition parameters
recodictreco parameters
raw_fidnumpy arraycomplex raw data
proc_datanumpy arraydata as processed in Paravision
k_datanumpy arraycomplex k-space data
reco_datanumpy arraycomplex reconstruction of k-space

To display e.g. the echo time of the currently loaded experiment, type

print Experiment.method["PVM_EchoTime"]

When an experiment is loaded with bruker.ReadExperiment(), the parameter files as well as the raw data and the processed data are read in. However, no reconstruction on the raw data is performed. This is described in the next section.

Reconstruction of an MRI experiment

To reconstruct the raw data of an experiment, simply type

Experiment.ReconstructKspace()

This will first call the function GenerateKspace(), which reorders the raw data to obtain a valid k-space. Then, the function _ReconstructKspace() is called, which decides, based on the experiment’s method, which function has to be called to reconstruct the data properly. The k-space and the reconstructed image data are then stored in the class attributes k_data and reco_data, respectively.

Note that both ReconstructKspace() and GenerateKspace() can only be called if the corresponding method is supported. Up to now, this is only the case for the FLASH method and for the UFZ_CEST_RARE method (ultrafast z-spectroscopy as described in this publication).

Loading a parameter file

Parameter files can also be loaded without loading the experiment by using the function ReadParamFile:

import BrukerMRI as bruker
FilePath = "example_dataset/100/method"
method_dict = bruker.ReadParamFile(FilePath)

brukermri's People

Contributors

cwitte avatar habi avatar jdoepfert avatar schmudo avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.