DiffusionPreparation

DiffusionPreparation#

class pypulseqpp.sequences.DiffusionPreparation[source]#

Bases: RfModule

Non-selective diffusion preparation with hard tip-down and storage pulses.

A matched gradient pair surrounds one refocusing pulse. Design one axis at b_value, then scale the pair for lower b-values and rotate it per direction. The closing spoiler is separate from the diffusion pair.

Parameters:
  • system (pypulseqpp.Opts) – System limits.

  • b_value (float) – Design b-value (s/mm^2). This is the largest the module can produce; everything else is reached by scaling down.

  • gradient_duration_s (float, default=0.02) – Duration of each diffusion lobe (s).

  • gradient_separation_s (float, default=0.03) – Onset-to-onset separation of the two lobes (s). Must exceed gradient_duration_s by enough to hold the refocusing pulse.

  • pulse_duration_s (float, default=0.0005) – Duration of each 90 (s).

  • refocusing_duration_s (float, default=0.001) – Duration of the 180 (s).

  • axis ({'z', 'x', 'y'}, default='z') – Axis the canonical pair is designed on.

  • spoiling_cycles (float, default=4.0) – Cycles of dephasing the closing spoiler winds across voxel_size_m.

  • voxel_size_m (float, default=0.001) – Length the dephasing is counted over (m).

  • labels (sequence of str, default=None) – Counters emitted on the first pulse’s block.

Attributes:
  • rf_prep (RfEvent) – The 90 that tips down.

  • rf_ref (RfEvent) – The 180 between the lobes.

  • rf_store (RfEvent) – The 90 that stores what is left.

  • g_diff (TrapEvent) – The diffusion lobe, published once because both sides play the same event. Scale it per b-value, rotate it per direction.

  • wait_first, wait_last (DelayEvent) – The gaps before and after the refocusing pulse, each absent when the timing leaves none.

  • gx_spoil, gy_spoil, gz_spoil (GradEvent) – The closing spoiler.

  • prep_labels (LabelSetEvent or list of LabelSetEvent) – One per name in labels.

  • b_value (float) – The design b-value achieved (s/mm^2).

  • max_b_value (float) – What this timing could reach at full gradient amplitude (s/mm^2).

Raises:

ValueError – If a duration is out of order, the separation cannot hold the refocusing pulse, or the b-value exceeds what the system can reach – the message says what it can.

Examples

>>> import pypulseqpp.sequences as design
>>> import pypulseqpp as pp
>>> system = pp.Opts(max_grad=40, grad_unit="mT/m", max_slew=150, slew_unit="T/m/s")
>>> prep = design.DiffusionPreparation(system, 500.0)
>>> round(prep.b_value)
500
>>> round(prep.scale_for(125.0), 3)
0.5

The whole module, pulses and diffusion lobes together. Both lobes have the same sign; the refocusing pulse between them inverts the phase accrued during the first, so the pair produces diffusion weighting rather than cancelling:

(svg)

../_images/pypulseqpp-sequences-DiffusionPreparation-1.svg

Methods

init_module

Build the module's block layout; implemented by the subclass.

publish

Publish events from the caller's locals and register keyword aliases.

register

Publish named events without requiring prior block registration.

scale_for

Return the gradient-amplitude factor for a requested b-value.

sim_rf

Simulate this module's pulse across off-resonance.

Attributes

blocks

Return block tuples in play order, retaining the original event objects.

duration

Duration of the module in seconds.

seq

Sequence holding the module's construction-time block layout.