SequenceDescription#
- class blochsim.SequenceDescription[source]#
Bases:
objectEvent stream and RF resources of one repetition of a sequence.
The ratio
crusher_dephasing_rad / voxel_size_msets the b-factor diffusion is damped by and the phase each dephasing order acquires under flow; a zero dephasing leaves both out.voxel_size_malso sets the distance a moving spin crosses, which washes out the voxel;Nonedeclares no voxel, so spin velocity has no effect.- crusher_dephasing_rad#
Dephasing wound across one voxel by the unbalanced gradient, in radians.
- Type:
- rf_raster_time_s#
Dwell the RF shapes are sampled on, in seconds. Pulses are integrated against it.
- Type:
Methods
Build a description by laying operators out end to end.
Read one repetition of a Pulseq sequence.
Plot the events: RF as stems of height equal to the flip, ADC as markers.
- classmethod from_operators()[source]#
Build a description by laying operators out end to end.
- Parameters:
*parts (Operator or tuple) – Operators in play order, or
(offset_s, operator)pairs.rf_definitions (mapping, default=None) –
{id: RfDefinition}. One ideal pulse under id 0 when not given.shim_definitions (mapping, default=None) –
{id: ShimDefinition}.subsequence_index (int, default=0) – Index of the subsequence within a scan.
crusher_dephasing_rad (float, default=0.0) – Dephasing of one crusher across a voxel, in radians. Diffusion and flow are zero without it.
voxel_size_m (float, default=None) – Voxel length the dephasing is wound across, in metres.
start_s (float or torch.Tensor, default=0.0) – Start time of the first operator, in seconds.
- Returns:
Lasting as long as the operators laid out end to end.
- Return type:
- classmethod from_pulseq()[source]#
Read one repetition of a Pulseq sequence.
- Parameters:
source (str, Path or sequence) – A
.seqfile, or an in-memory pypulseq or pypulseqppSequence.**settings –
tr_index,subsequence_index,crusher_dephasing_radandvoxel_size_m, as forread_pulseq_description:tr_indexis the repetition to read, in wholeTRSizewindows.
- Returns:
One repetition, with events in microseconds from the start of the repetition.
- Return type:
- Raises:
ValueError – If the file declares no
TRSize,tr_indexis out of range, or the repetitions differ and none was named.
- plot()[source]#
Plot the events: RF as stems of height equal to the flip, ADC as markers.
- Parameters:
axis (matplotlib.axes.Axes, default=None) – Axes to draw on; a new figure when not given.
upto_s (float, default=None) – Plot events up to this time, in seconds.
- Returns:
The axes drawn on; time in ms against flip angle in degrees.
- Return type:
- Raises:
ImportError – If matplotlib is not installed.
- property adc_events#
Return ADC events in state-machine order.