Sequence.adc_kspace

Sequence.adc_kspace#

Sequence.adc_kspace()[source]#

Return the k-space location of each ADC sample, in 1/m.

The first result of calculate_kspace(), integrated the same way with block rotations applied, without sampling the trajectory between the samples; excitations reset it and refocusing pulses invert it.

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.

  • readouts (Sequence[int], default=None) – Half-open range (first, stop) of 0-based readout indices, in the order of adc_echoes(). Only those readouts’ samples are returned, at the positions the whole sequence gives them. Not with block_range; see Notes.

Returns:

(3, n): one column per ADC sample, in play order.

Return type:

NDArray[np.float64]

Raises:

ValueError – If both block_range and readouts are given, or readouts is not two indices 0 <= first <= stop <= the number of readouts.

Notes

With readouts, k-space is integrated from the last block before readout first that plays an excitation (or a pulse with no use recorded) and does not acquire. A trajectory delay that moves an earlier block’s gradient past that pulse’s centre is therefore not seen.

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
>>> seq.adc_kspace().shape
(3, 64)
>>> seq.adc_kspace(readouts=(0, 1)).shape
(3, 64)