Skip to content

The original bloch equation simulator was a Matlab mex file created by Brian Hargreaves at Stanford University. This modification to run it as a Python C extension

gopal-nataraj/bloch-sim-py

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bloch-sim-py

The original bloch equation simulator was a matlab mex file created by Brian Hargreaves at Stanford University. This is a modification to run it as a python C extension. The simulator was used in a graduate MRI class taught by Miki Lustig. Lustig wrote several helper modules in matlab, which have also been converted to python here.

This module was developed on a linux platform and has been since been tested on macos 10.14.6.

Minor edits by Gopal Nataraj

Dependencies

python 3.7
numpy 1.16.4
scipy 1.3.0
matplotlib 3.1.0

Other versions have not been tested, but there should be some flexibility.

Installation

First, make sure your build environment can build python c extensions. Here are some instructions that may help on macs.

Next, run pip install -e . from the base directory.

Use from bloch import bloch for the primary bloch simulator function.

Testing

Run python -m unittest from the base directory.

License

This library is distributed under the same terms as Brian's original bloch simulator.

Acknowledgments

Thanks to Brian for the original bloch simulator, Miki for the helper modules, and NPann for assisting with a critical bug fix.

About

The original bloch equation simulator was a Matlab mex file created by Brian Hargreaves at Stanford University. This modification to run it as a Python C extension

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 63.4%
  • C 36.2%
  • Makefile 0.4%