A MATLAB package for optimization of gradient waveforms that yield b-tensors of arbitrary shape that can be tailored to pulse sequence timing and hardware restrictions.
The optimizer supports the following:
- Arbitrary b-tensor shape
- Variable raster resolution
- Asymmetric sequence timing
- Control for 0th-moment balance
- Control for energy consumption/heating
- L2 and max-norm amplitude constraints
- Nulling of concomitant gradient effects
- Nulling of motion encoding
First, download (clone or fork) this repository and open it in MATLAB. You can generate waveforms in a graphical interface by calling NOW_GUI.m
. To access all optimization controls, you can run the optimization via a script. An example script is provided in scripted_NOW_example.m
.
Setting up the optimizer always follows these steps:
- Create object that specifies optimization problem by calling
pObj = optimizationProblem()
- Modify
pObj
to your specification - Update the derived parameters of
pObj
by feeding it through the functionpObj = optimizationProblem(pObj)
- Call the optimizer run function using
pObj
as input, according to[result, pObj] = NOW_RUN(pObj)
The result
structure contains several fields; among them is the gradient waveform. Notably, the fields gwf
, rf
and dt
, are compatible with the multidimensional diffusion (md-dMRI) framework format. With the md-dMRI framework installed, an overview of the resulting gradient waveform can be plotted by calling gwf_plot_all(result.gwf, result.rf, result.dt)
.
The optimization framework contains contains several sub-functions, all of which are part of the master branch of this repository. Please consider citing the following papers if you use NOW in your research or applications.
-
The underlying optimization framework by Sjölund et al. (2015), as described here:
Sjölund J, Szczepankiewicz F, Nilsson M, Topgaard D, Westin C-F, and Knutsson H. Constrained optimization of gradient waveforms for generalized diffusion encoding. Journal of Magnetic Resonance 261 (2015), 157-168. -
Concomitant gradient compensation (Maxwell compensation) by Szczepankiewicz et al. (2019), patent, as described here:
Szczepankiewicz F, Westin C‐F, and Nilsson M. Maxwell‐compensated design of asymmetric gradient waveforms for tensor‐valued diffusion encoding. Magn Reson Med 82 (2019) 1424–1437 -
Motion compensation by Szczepankiewicz et al. (2021), as described here:
Szczepankiewicz F, Sjölund J, Dall’Armellina E, Plein S, Schneider E J, Teh I, and Westin C-F, Motion-compensated gradient waveforms for tensor-valued diffusion encoding by constrained numerical optimization. Magn Reson Med (2021) -
Cross-term compensation by Szczepankiewicz and Sjölund (2021), as described here:
Szczepankiewicz F and Sjölund J, Cross-term-compensated gradient waveform design for tensor-valued diffusion MRI. Journal of Magnetic Resonance (2021)
Gradient waveforms can be intended for many kinds of purposes and deployed on vastly different hardware. The general design of gradient waveforms for dMRI, with special focus on tensor-valued encoding, has been described in:
- General gradient waveform design by Szczepankiewicz et al. (2021):
Szczepankiewicz F, Westin C-F, and Nilsson, M, Gradient waveform design for tensor-valued encoding in diffusion MRI. Journal of Neuroscience Methods (2021)
To run user-defined gradient waveforms a special MRI pulse sequence is usually required. Pulse sequences are available for multiple vendors and scanner software versions. Please refer to the free waveform (FWF) encoding resource site for more information.
We welcome contributions from anyone! NOW is an open-source project that aspires to be community-driven. If you have a feature request or discover a bug, please submit an issue or - even better - fix it and make a pull request. If you plan to make major changes, it might be a good idea to first submit an issue to discuss what you would like to change.
The following toolboxes are called during optimization:
- Curve Fitting Toolbox
- System Identification Toolbox
- Optimization Toolbox
- Simulink Control Design
- Statistics and Machine Learning Toolbox
- Computer Vision Toolbox
List was derived from pList.Name
by calling: [fList,pList] = matlab.codetools.requiredFilesAndProducts('scripted_NOW_Example.m');
This work is published under the BSD 3-Clause License.