Note
Go to the end to download the full example code.
3D Cartesian MPRAGE#
An inversion preparation is followed after the prescribed inversion delay by a
train of low-flip-angle spoiled Cartesian gradient echoes. The inversion time
is measured to the first excitation centre; the corresponding central ADC
sample occurs one TE later. The ordering assigns recovery times within each
inversion cycle to (line, partition) views. MPRAGE is used for
high-resolution 3D T1-weighted structural imaging.
Timing structure#
Each cycle comprises inversion, crusher, inversion delay, spoiled
gradient-echo train and recovery interval. ti=None and tr=None take the
shortest inversion time and recovery supported by the modules. Trains of four
views provide a compact timing diagram. Clinical matrices typically
require inversion times of several hundred milliseconds and much
longer readout trains.
from pypulseqpp.sequences import mprage3D_sequence
compact = mprage3D_sequence(n_x=128, n_y=4, n_z=4, ti=None, tr=None, n_dummy=0)
print(
f"{compact.num_blocks} blocks, {compact.duration()[0]:.2f} s, "
f"TI {compact.get_definition('TI')[0] * 1e3:.0f} ms, "
f"TR {compact.get_definition('TR')[0] * 1e3:.0f} ms"
)
60 blocks, 0.12 s, TI 8 ms, TR 41 ms

Sampling order#
At a protocol matrix, every inversion cycle acquires a train of
ceil(n_y / ry) views. The radial ordering deals the trains as angular
wedges of the ky-kz plane, each read centre-out: the index within the train
grows with the distance from the centre, and one train starts at the centre
of k-space. TI is measured from the inversion-pulse centre to that view’s
excitation-pulse centre; the central ADC sample occurs one echo time later,
at TI + TE. Peripheral views are acquired later in the recovery. The
sampled views are filled to a whole number of trains with the unsampled
views nearest the centre, so every train has the same length.
protocol = mprage3D_sequence(n_x=192, n_y=128, n_z=24, ti=0.9, tr=2.3, n_dummy=0)
print(
f"{protocol.duration()[0]:.1f} s, "
f"{int(_places(protocol, 'inversion').max()) + 1} "
"readouts per train, "
f"central ADC at {(protocol.get_definition('TI')[0] + protocol.get_definition('TE')[0]) * 1e3:.1f} ms"
)

43.7 s, 128 readouts per train, central ADC at 904.0 ms
Accelerated sampling#
ry and rz subsample the line and partition axes. caipi_shift
offsets the sampled partitions between adjacent lines to control the alias
distribution. ry shortens every train, which reduces both its duration and
the range of inversion-recovery weighting; rz reduces the number of
trains. Scan duration equals the number of inversion cycles multiplied by TR;
the fully sampled calibration region adds views at every undersampling.
accelerated = mprage3D_sequence(
n_x=192, n_y=128, n_z=24, ry=2, rz=2, caipi_shift=1, ti=0.9, tr=2.3, n_dummy=0
)

views cycles per train scan (s)
1 x 1 2432 19 128.0 43.7
2 x 2, shift 1 896 14 64.0 32.2
Total running time of the script: (0 minutes 0.976 seconds)