Source code for console.interfaces.unrolled_sequence
"""Interface class for an unrolled sequence."""
from dataclasses import dataclass
import numpy as np
from console.interfaces.acquisition_parameter import AcquisitionParameter
[docs]
@dataclass(slots=True, frozen=True)
class UnrolledSequence:
"""Unrolled sequence interface.
This interface is used to share the unrolled sequence between the
different components like TxEngine, SequenceProvider and AcquisitionControl.
An unrolled sequence is generated by a `SequenceProvider()` instance using the
`unroll_sequence` function.
"""
seq: np.ndarray
"""Replay data as int16 values in a list of numpy arrays. The sequence data already
contains the digital adc and unblanking signals in the channels gx and gy."""
sample_count: int
"""Total number of samples per channel."""
gpa_gain: list[float]
"""The gradient waveforms in pulseq are defined in Hz/m.
The translation to mV is calculated by 1e3 / (gyro * gpa_gain * grad_efficiency).
The gpa gain is given in V/A and accounts for the voltage required to generate an output of 1A.
The gyromagnetic ratio defined by 42.58e6 MHz/T."""
gradient_efficiency: list[float]
"""The gradient waveforms in pulseq are defined in Hz/m.
The translation to mV is calculated by 1e3 / (gyro * gpa_gain * grad_efficiency).
The gradient efficiency is given in mT/m/A and accounts for the gradient field which is generated per 1A.
The gyromagnetic ratio defined by 42.58e6 MHz/T."""
rf_to_mvolt: float
"""If sequence values are given as float values, they can be interpreted as output voltage [mV] directly.
This conversion factor represents the scaling from original pulseq RF values [Hz] to card output voltage."""
dwell_time: float
"""Dwell time of the spectrum card replay data (unrolled sequence).
Defines the distance in time between to sample points.
Note that this dwell time does not correlate to the larmor frequecy. Due to the sampling theorem
`dwell_time < 1/(2*larmor_frequency)` must be satisfied. Usually a higher factor is chosen."""
duration: float
"""Total duration of the unrolled sequence in s."""
adc_count: int
"""Number of adc events in the sequence."""
parameter: AcquisitionParameter
"""Hash of acquisition parameters used to calculate the sequence."""