Skip to content

makeExtendedTrapezoidArea

Generates the shortest possible extended trapezoid gradient waveform with a specified area, starting and ending with optionally non-zero gradient values. The function uses optimization techniques (fminsearch) to find the optimal gradient amplitude and plateau duration to achieve the desired area while respecting system limits (maximum gradient amplitude and slew rate).

Syntax

function [grad, times, amplitudes] = makeExtendedTrapezoidArea(channel, Gs, Ge, A, sys)

Calling Pattern

mr.makeExtendedTrapezoidArea(...)

Parameters

Required Parameters

Name Type Description Example Units
channel char The gradient channel ('x', 'y', or 'z') for which to create the waveform. 'x'
Gs double The starting gradient amplitude. 100 Hz/m
Ge double The ending gradient amplitude. 100 Hz/m
A double The desired area of the extended trapezoid. 0.1 1/m
sys struct A structure containing system parameters. Must include fields like 'maxSlew' (maximum slew rate in Hz/m/s), 'gradRasterTime' (gradient raster time in seconds), and 'maxGrad' (maximum gradient amplitude in Hz/m). mr.opts()

Returns

Output Type Description
grad struct A Pulseq gradient waveform structure containing the generated extended trapezoid.
times double A vector of time points (in seconds) defining the waveform.
amplitudes double A vector of gradient amplitudes (in Hz/m) corresponding to the time points.

Examples

% Create refocusing gradient with spoiler areas
g_ref_pre = mr.makeExtendedTrapezoidArea(g_ref.channel, 0, g_ref.amplitude, spAz+gzr.area, system);
g_ref_post = mr.makeExtendedTrapezoidArea(g_ref.channel, g_ref.amplitude, 0, spAz, system);

% Slice spoiling gradient starting from zero
gzSpoil = mr.makeExtendedTrapezoidArea('z', 0, gz.amplitude, sp_area_needed, sys);

% Readout spoiling gradient with amplitude transition
groSp = mr.makeExtendedTrapezoidArea(gro.channel, gro.amplitude, 0, deltak(ax.n1)/2*N(ax.n1)*ro_spoil, sys);

See Also

mr.makeExtendedTrapezoid