Sequence.calculate_kspace#
- Sequence.calculate_kspace()[source]#
Integrate the gradients with excitation resets and refocusing.
Each block’s rotation is applied. K-space coordinates are in 1/m.
- Parameters:
trajectory_delay (float | ArrayLike, default=0.0) – Per-axis timing correction (s); positive values advance the gradient.
gradient_offset (float | ArrayLike, default=0.0) – A background gradient per axis, in Hz/m.
block_range (Sequence[int], default=None) – Two 1-based block indices; only those blocks are followed.
- Returns:
k_traj_adc (NDArray[np.float64]) –
(3, n): the k-space location of each ADC sample, in 1/m.k_traj (NDArray[np.float64]) – Full trajectory in 1/m, sampled through ramps and at event times.
t_excitation (NDArray[np.float64]) – Centre of each excitation pulse, in seconds from the start of the selected range.
t_refocusing (NDArray[np.float64]) – Centre of each refocusing pulse, in seconds from the same origin.
t_adc (NDArray[np.float64]) – Time of each ADC sample, in seconds from the same origin.
Examples
>>> import numpy as np >>> import pypulseqpp as pp >>> seq = pp.Sequence(pp.Opts()) >>> seq.add_block(pp.make_block_pulse(np.pi / 2, duration=1e-3)) 1 >>> seq.add_block(pp.make_adc(num_samples=64, duration=3.2e-3)) 2 >>> k_traj_adc, k_traj, t_excitation, t_refocusing, t_adc = seq.calculate_kspace() >>> k_traj_adc.shape, t_excitation ((3, 64), array([0.0005]))