SSFP
Simple steady-state free precession simulation. The goal is to provide a simple to use, pip-installable solution for simulating and working with this wonderful pulse sequence.
In this package:
bSSFP: bssfp()
FIMTRE: fimtre()
GRE: gre()
GS solution: gs_recon()
PLANET: planet()
3D Region Growing Phase Correction: rgphcorr3d()
Robust Coil Combination: robustcc()
Installation
Should be as easy as:
python -m pip install ssfp
Usage
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, df = planet(
phased_cycled_pixels, alpha, TR, T1_guess,
pcs=np.deg2rad([0, 90, 180, 270, etc...]))
3D Region Growing Phase Correction [5] is an algorithm for determining water and fat images from a single bSSFP acquisition. It can be called like this:
from ssfp import rgphcorr3d
phase_corrected = rgphcorr3d(
dataset3d, cellsize=(4, 4, 4), slice_axis=-1)
# see ssfp.examples.basic_rgphcorr for full usage example
Robust Coil Combination for bSSFP Elliptical Signal Model [6] is a coil combination method that preserves the elliptical relationships between phase-cycled pixels. It has two variants: simple and full. By default, the simple method is called. The full method is very slow and only used for validation of the simple method. Robust coil combination can be called like this:
from ssfp import robustcc
sx, sy, sz, num_pc, num_coils = data.shape[:]
coil_combined = robustcc(data, pc_axis=-2, coil_axis=-1)
# see ssfp.examples.basic_robustcc for more usage examples
Changelog
1.2.0: setup.py -> pyproject.toml; GPL -> MIT licence; general maintenance; dependency version bumps; type annotations; divide-by-zero fixes
1.0.0: bssfp() function overhaul to allow arbitrarily dimensioned input arrays or scalars and removes the target_pc_axis argument.
References
Metadata
Release files for ssfp 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ssfp-1.2.0.tar.gz | 33.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ssfp-1.2.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 75.3 kB
Release files / ssfp-1.2.0.tar.gz
| Download URL | ssfp-1.2.0.tar.gz |
|---|---|
| Size | 33.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77c26f280de44a54800616360150a783055f037b19f1b3fe09fb3738d7657062
|
|
BLAKE2b-256 checksum How to use checksums |
164c2febcb7134cb90220fd33643405494961abcf4661104f0bae4971ed4ca8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / ssfp-1.2.0-py2.py3-none-any.whl
| Download URL | ssfp-1.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 41.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
18dadb3979c708bbefaef08cb62b2da63b1925cf22bcdf3c3849b0b58cfc18db
|
|
BLAKE2b-256 checksum How to use checksums |
d80009f985bf843c6332c48b426a889a9de48de5998925c0505d6d6166d2ea46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for ssfp 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.