Skip to content

helloxss/quantitative

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Quantitative

This is the home of a project that seeks to leverage the vast array of tools available in Python to create an open source framework for the analysis of quantitative MRI methods. Users are free to use it as is but contributions are also welcome. With new pulse sequences, signal equations, and framework improvements, we can build a tool together that becomes a new standard for the quantitative imaging community.

Please enjoy my ISMRM2014 ePoster for an introduction to the Cramér-Rao Lower Bound, optimal experimental design, and its application to DESPOT1/2.

Features

  • Calculation of the Cramér-Rao Lower Bound via automatic differentiation
  • Optimal experimental design using the Fisher information matrix and CRLB as a criterion

Future

  • Analysis of signals described by Bloch simulation and extended phase graph methods

Current applications

Requirements

The chief requirements for this package beyond NumPy and SciPy are theano, decorator, and PyAutoDiff. The first two are available through PyPI but PyAutoDiff must be installed manually.

Getting Started with Python

Installation

The best way to install Python for scientific computing is with a pre-made environment or bundle of packages. There are many competitors but two of the major players are: Anaconda and Enthought Canopy (formerly Enthought Python Distribution). These are both free. Paid or academic licenses offer access to accelerated libraries or better support. They help to assemble the most widely used open source community projects including NumPy, Matplotlib, SciPy, and IPython in a one-click install. There are also sites that let you use Python through the web like Wakari.

Most major Python packages are available from the central package index, PyPI. New packages can be pulled and installed from PyPI with the shell commands:

  • easy_install <package name>
  • pip install <package name>

Admin privileges are usually required.

Learning

There is of course a heavy inertia to learning a new programming language, but I believe the effort is well worth it especially if you'd like to move beyond Matlab. Some of the advantages include better support for parallel computing (no more arbitrary limit on your number of threads and there are many packages that make cluster computing easy), convenient interfacing to many languages (C++, Fortran, R, Matlab, etc.), and cutting edge code-analysis packages that can automatically do just-in-time compilation of your code to run faster on your CPU or GPU. I found the following resources immensely helpful:

  • Dive Into Python is a strong place to start. The things learned here may not be immediately useful for scientific computing but they provide concepts and paradigms that will shape how you structure your future Python code.
  • LearnPython, Codecademy, and Codewars provide some online interactive tutorials, no installation required.
  • Python Scientific Lecture Notes gives a thorough introduction to NumPy, SciPy, and matplotlib. This is where Python becomes a force for scientific inquiry. It will feel right at home for Matlab and R users.
  • PyVideo is an amazing resource that catalogs training sessions and talks from past PyCon events. These typically cost thousands of dollars to attend in person.
  • IPython introduction teaches how to get started with IPython as a convenient way to code and visualize data in a single integrated interface.
  • A matplotlib gallery on top of the main one
  • PEP-8 Programming Style is a useful set of guidelines for Python coding style. Python provides a lot of freedom as a language and as programmers we must use exercise it responsibly. By following these conventions we improve code clarity and give a base understanding that everyone starts from.

Programming

  • SublimeText is a multi-platform text editor that has highlighting for many programming languages including Python. It also happens to be written in Python. Version 3 is the way to go. Be sure to grab Package Control to install plugins, like the excellent on-the-fly code-checking tool, Anaconda (no relation to the previously mentioned environment).
  • PyCharm is an excellent IDE with good tab-completion and debugger tools
  • Spyder mimics a MATLAB-like development enviroment.
  • IPython Notebook emulates a Mathematica-style environment and is also similar to MATLAB cells. Run ipython notebook --pylab=inline from your shell. This causes graphics to appear in the document as opposed to in a new window and also starts up Python with Pylab, i.e. NumPy, SciPy, and Matplotlib
  • Never use python alone, use IPython and IPython QTConsole. They support tab completion and provide many shell commands to let you ls or cd around through directories. Run ipython qtconsole --pylab=inline from the shell.

Authors and Contributors

Jason Su, Stanford University (@sujason)

and You!

About

Optimal experimental design with automatic differentiation using the Fisher information matrix and Cramer-Rao Bound

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%