Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

SSFP simulation

Project description


Simple steady-state free precession simulation. The goal is to provide a simple to use, pip-installable solution for simulating this wonderful pulse sequence.

In this package:

  • bSSFP: bssfp()
  • GS solution: gs_recon()


Should be as easy as:

pip install ssfp


See ssfp.examples for typical usage. You can run examples like:

python -m ssfp.examples.basic_bssfp

Balanced steady-state free precession can be called through bssfp(). This is an implementation of equations [1–2] in [1]. These equations are based on the Ernst-Anderson derivation [2] where off-resonance is assumed to be subtracted as opposed to added (as in the Freeman-Hill derivation [3]). Hoff actually gets Mx and My flipped in the paper, so we fix that here. We also assume that the field map will be provided given the Freeman-Hill convention.

from ssfp import bssfp

# Here's the simplest usage, see docstring for all the possible
# function arguments
sig = bssfp(T1, T2, TR, alpha)

We can also easily get the Geometric Solution to the elliptical signal model as described in [1] as follows:

from ssfp import gs_recon
recon = gs_recon(phased_cycled_images, pc_axis=-1)

# Notice that we can specify the axis where the phase-cycles live

PLANET [4] is a method for simultaneous T1, T2 fitting for bSSFP phase-cycled data. Call like this:

from ssfp import planet

# For a single pixel:
Meff, T1, T2 = planet(
    phased_cycled_pixels, alpha, TR, T1_guess,
    pcs=np.deg2rad([0, 90, 180, 270, etc...]))


[1](1, 2) Xiang, Qing‐San, and Michael N. Hoff. “Banding artifact removal for bSSFP imaging with an elliptical signal model.” Magnetic resonance in medicine 71.3 (2014): 927-933.
[2]Ernst, Richard R., and Weston A. Anderson. “Application of Fourier transform spectroscopy to magnetic resonance.” Review of Scientific Instruments 37.1 (1966): 93-102.
[3]Freeman R, Hill H. Phase and intensity anomalies in fourier transform NMR. J Magn Reson 1971;4:366–383.
[4]Shcherbakova, Yulia, et al. “PLANET: an ellipse fitting approach for simultaneous T1 and T2 mapping using phase‐cycled balanced steady‐state free precession.” Magnetic resonance in medicine 79.2 (2018): 711-722.

Project details

Download files

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

Files for ssfp, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size ssfp-0.2.0-py3-none-any.whl (28.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size ssfp-0.2.0.tar.gz (13.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page