Skip to main content

Magnetic Resonance Arbitrary Gradient Toolbox (MRArbGrad)

Python library for solving gradient waveforms for arbitrary MRI trajectories. Trajectories can be specified as a Python function, or as a set of k-space points. A trajectory library is also provided. The underlying C/C++ code can be ported to compatible pulse sequence projects for fast gradient waveform design.

How to use

Install

$ pip install mrarbgrad

Import Libraries

from numpy import *
import mrarbgrad as mag

Define Your Trajectory Function

def Rosette(t):
    rho = 0.5 * sin(5*pi*t)
    phi = 3*pi*t
    return rho*array([cos(phi), sin(phi)])

Solve for the Gradient Waveform

grad = mag.solve(Rosette, pmin=0, pmax=1)

pmin and pmax define the bounds of function argument t. grad[:,0], grad[:,1], and grad[:,2] are the x-, y-, and z-axis gradient waveforms, respectively.

For more usages such as specifying the hardware constraints, use of trajectory library and other utilities, please refer to Examples.

Acknowledgements

The algorithm in this library is proposed in:

[1] Luo R, Huang H, Miao Q, Xu J, Hu P, Qi H. Real-Time Gradient Waveform Design for Arbitrary k-Space Trajectories. IEEE Transactions on Biomedical Engineering. 2026 Oct;73(10):3491-502. doi:10.1109/TBME.2026.3654117

Metadata

Release files for MRArbGrad 5.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MRArbGrad 5.0.0
File Size Uploaded
mrarbgrad-5.0.0.tar.gz 26.7 kB Details

Release files / mrarbgrad-5.0.0.tar.gz

Download URL mrarbgrad-5.0.0.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a747b117b4d423b0d375c7d2bf39ac41511eea1cc5d5854b71997cbb76d03183
BLAKE2b-256 checksum
How to use checksums
2710f781399318c433dde209d6381533446d5685b2cb0e122cffbb6fe8eefe34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

5.1.5

1 release file

5.1.4

1 release file

5.1.3

1 release file

5.1.2

1 release file

5.1.1

1 release file

5.1.0

1 release file

This release

5.0.0 This release

1 release file

4.4.1

1 release file

4.4.0

1 release file

4.3.0

1 release file

4.2.0

1 release file

4.1.1

1 release file

4.1.0

1 release file

4.0.0

1 release file

3.1.0

1 release file

3.0.1

1 release file

3.0.0

1 release file

2.1.0

1 release file

2.0.1

1 release file

1.1.6

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.4

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page