ReadoutTable

Contents

ReadoutTable#

class pulserver.mrd.ReadoutTable[source]#

Bases: object

Every ADC readout of one sequence, in play order.

Tabulating follows k-space through the whole sequence once, to find each readout’s echo. Where Sequence.adc_echoes returns each readout’s k as its block’s origin plus the sweep of a block of its kind, readout_k() adds the two. Otherwise k-space is integrated a run of consecutive readouts at a time, by Sequence.adc_kspace(readouts=...), from the last pulse before the run that resets it, when the readout’s run is not among the last few kept. The table holds the sequence for this, which must not change once tabulated.

Attributes:
  • block (ndarray) – int64, 1-based index of the block holding each readout.

  • num_samples (ndarray) – int32 samples per readout.

  • dwell (ndarray) – float64 dwell time, in seconds.

  • labels (dict of str to ndarray) – Every label the sequence writes, with the int32 value in force at each readout. Labels the sequence never writes are absent.

  • center_sample (ndarray) – int32 echo index: of the samples pypulseqpp.Sequence.adc_echoes finds nearest the centre of k-space over the axes the readout moves along, the last, or the first on a readout labelled REV, so reversed lines mirror onto forward ones. -1 when no axis moves.

  • trajectory_dimensions (ndarray) – int8 axes of readout_k() a readout keeps once the trailing axes it does not move along are dropped; 0 when no axis moves.

Examples

>>> import pypulseqpp as pp
>>> from pulserver.mrd import ReadoutTable
>>> seq = pp.Sequence(pp.Opts())
>>> gx = pp.make_trapezoid("x", flat_area=160.0, flat_time=3.2e-3)
>>> adc = pp.make_adc(num_samples=32, duration=3.2e-3, delay=gx.rise_time)
>>> rewinder = pp.make_trapezoid("x", area=-gx.area / 2, duration=1e-3)
>>> for events in ((rewinder,), (gx, adc), (rewinder,)):
...     _ = seq.add_block(*events)
>>> table = ReadoutTable.from_sequence(seq)
>>> int(table.center_sample[0]), int(table.trajectory_dimensions[0])
(16, 1)

Methods

from_sequence

Tabulate the readouts of a pypulseqpp.Sequence.

readout_block

Return the decoded block holding one readout, as Sequence.get_block does.

readout_k

Return the k-space position of each sample of one readout, in 1/m.

readout_phase_modulation

Return the phase modulation of one readout's ADC, in rad, or None.

Attributes