Skip to main content

Magnetic Resonance Arbitrary Gradient Toolbox (MRArbGrad)

Python library for designing the 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 the function parameter 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 the trajectory library and other utilities, please refer to the 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.1.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.1.0
File Size Uploaded
mrarbgrad-5.1.0.tar.gz 107.8 kB Details

Release files / mrarbgrad-5.1.0.tar.gz

Download URL mrarbgrad-5.1.0.tar.gz
Size 107.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a8542627c8288fd149b113a2f23f4582260f36ebea1ab9687fd04739f0d36422
BLAKE2b-256 checksum
How to use checksums
9b88c1a5c4e29ec87adc45971f72f2056299099e2688ba0bcb9627cb52f7f9cb
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

This release

5.1.0 This release

1 release file

5.0.0

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