Skip to main content

Gradient waveform design tool for arbitrary k-space trajectories.

Project description

Magnetic Resonance Arbitrary Gradient Toolbox (MRArbGrad, MAG)

Introduction

This toolbox is a pip package with C++ backend. The pip package can be called via Python interface to generate non-Cartesian gradient waveforms for built-in and external trajectories. The C++ source code (in mrarbgrad_src/ext/) can be ported to other pulse sequence project like UIH's Adept project for gradient waveform calculation.

Install

Optionally, to create a new conda environment (in case the dependencies in this package break your current environment), please run:

$ conda create -n magtest -y
$ conda activate magtest
$ conda install python==3.10 -y

This package is NOT restricted to use Python 3.10 or numpy 1.26 (as specified in the requirements.txt). Feel free to adjust at your convenience, just if the package works.

To install the pip package of the proposed algorithm (including the trajectory library built on it), and also the dependencies:

$ pip install -r requirements.txt
$ bash install.bash

It's the best practice to use my script install.bash for installation. You can also install via pip install . but remember to delete *.egg-info or pip will run into bug when uninstalling this package in current folder (see comments in install.bash).

Examples & Usages

Examples for generating gradient waveforms for either built-in trajectory (trajectory library) or external trajectory (expressed by trajectory function or trajectory samples) can be found in the example folder.

Citation

If this project helps you, please cite our paper:

[1] R. Luo, H. Huang, Q. Miao, J. Xu, P. Hu, and H. Qi, “Real-Time Gradient Waveform Design for Arbitrary k-Space Trajectories,” Sep 9, 2025, arXiv preprint arXiv:2507.21625.

Project details


Download files

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

Source Distribution

mrarbgrad-1.1.4.tar.gz (30.2 kB view details)

Uploaded Source

File details

Details for the file mrarbgrad-1.1.4.tar.gz.

File metadata

  • Download URL: mrarbgrad-1.1.4.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for mrarbgrad-1.1.4.tar.gz
Algorithm Hash digest
SHA256 3a29ec78abc6033d2aabc20f873cb19d2da02c1a6b0787b1a58e8f22700016f4
MD5 7ab566a6c375ce32428a40cfb0908415
BLAKE2b-256 596ab9095504971f6451c2692b3a6a3db83c6a26b80808495ba442ec103d450a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page