make_pd_schedule#
- pypulseqpp.make_pd_schedule()[source]#
Design a PD refocusing train by relaxation-aware inverse EPG.
- Parameters:
length (int) – Total RF count, including startup; at least
startup_echoes + 2.echo_spacing (float) – Echo spacing (s), positive; shared by all trains of an acquisition.
first_echo_time (float | None, default=None) – Excitation-to-first-echo time (s).
Noneusesecho_spacing.first_flip_angle (float, default=np.deg2rad(120.0)) – First refocusing angle (rad), independent of the peak and final angle.
maximum_flip_angle (float, default=np.deg2rad(140.0)) – Maximum actual refocusing angle (rad), positive and below pi.
final_flip_angle (float, default=np.deg2rad(100.0)) – Final actual refocusing angle (rad), positive and at most the maximum. Equality allows the RF maximum to extend to the final pulse.
plateau_fraction (float, default=0.7) – Fraction of the acquired train before the gently declining signal tail begins, strictly between 0 and 1. This sets signal-tail onset; the actual RF peak position follows from EPG rather than interpolation.
startup_echoes (int, default=6) – Leading unacquired pulses. This function emits angles, not ADC events.
initial_decay (float, default=1.3) – Initial signal-transition exponential time constant (echoes).
reference_t1 (float, default=1.0) – Reference T1 for inverse EPG (s), positive and finite.
reference_t2 (float, default=0.1) – Reference T2 for inverse EPG (s), positive and finite.
- Returns:
Actual refocusing angles (rad), shape
(length,), including startup. Each call returns an independent array.- Return type:
- Raises:
ValueError – If counts, controls or timing are invalid, or no feasible envelope realizes the prescribed maximum/final angles and initial signal drop.
ImportError – If blochsim, which inverts the phase graph, is not installed.
Notes
The prescribed signal has an initial exponential drop, a nearly constant middle and a quadratic declining tail with zero slope at its onset, following the PD signal-evolution design principle of Mugler et al. [1]. Two scalar signal levels are solved to enforce the actual maximum and final RF angles. Minimum and centre angles are outputs, without an imposed strict inequality. The peak may precede the final pulse. Accepted trains reproduce their target in-phase signal without pulse-by-pulse clipping. This is an independent design, not a numerical reconstruction of Siemens PDvar*.
EPG assumes a fully relaxed ideal 90-degree excitation and instantaneous CPMG pulses with longitudinal recovery. Finite RF profiles, actual B1 and inter-shot steady state require separate forward evaluation.
Examples
>>> import numpy as np >>> import pypulseqpp as pp >>> angles = pp.make_pd_schedule(26, 0.003416, first_echo_time=0.004162) >>> np.allclose(np.rad2deg(angles[[0, -1]]), [120, 100], atol=1e-4) True >>> bool(np.isclose(np.rad2deg(angles.max()), 140, atol=1e-4)) True
References