Diffusion Encoding#

This module contains functions defining compositions of building blocks commonly used in diffusion MRI

Functions:

bipolar(system_specs, dt, Dt, amplitude, ...)

Defines a bipolar M0-compensated gradient waveform:

m012(system_specs, zeta, lambda_, direction)

Defines a M012-compensated diffusion gradient waveform according to Stoeck et al. (DOI: 10.1002/mrm.25784):.

shortest_m012(system_specs, direction, bvalues)

Finds the shortest possible second order motion compensated diffusion weighting gradient waveform according to Stoeck et al. (DOI: 10.1002/mrm.25784).

bipolar(system_specs, dt, Dt, amplitude, direction, start_time=<Quantity(0.0, 'millisecond')>, rise_time=None, flip_decoding=False)#

Defines a bipolar M0-compensated gradient waveform:

.                  |-dt-|               |-dt-|                  .
.                   _____                                       .
.                  /     \                                      .
.        _________/       \___________         _____            .
.        |-delay-|        |----Dt----|\       /                 .
.                                      \_____/                  .
.                 |-|   |-|          |-|     |-|                .
.                          rise_time                            .
Parameters:
  • system_specs (SystemSpec) –

  • dt (Quantity) – Quantity - flat duration of lobes

  • Dt (Quantity) – Quantity - flat duration between lobes

  • amplitude (Quantity) – Quantity - amplitude of lobes

  • direction (ndarray) – (3, ) direction of gradient axis (is normalized internally)

  • start_time (Quantity) – time offset before first lobe (to begin of rise)

  • rise_time (Optional[Quantity]) – time of rise/fall, if not provide, system default is used

  • flip_decoding (bool) – In case of spin-echo sequences, the decoding lobes need to be inverted. If this argument is set to True the inversion is done internally.

Return type:

Sequence

Returns:

sequence object

m012(system_specs, zeta, lambda_, direction, amplitude=None, bvalue=None, start_time=<Quantity(0.0, 'millisecond')>, flip_decoding=False)#

Defines a M012-compensated diffusion gradient waveform according to Stoeck et al. (DOI: 10.1002/mrm.25784):

.           lambda               Delta               lambda           .
.           _____                       _________                     .
.          /     \                     /         \                    .
.       __/       \             ______/           \         _____     .
.                  \           /                   \       /          .
.                   \_________/                     \_____/           .
.         |-|          Lambda             Lambda                      .
.         zeta                                                        .
\[\begin{split}\Lambda =& 2\lambda + \zeta \\ \Delta =& 2\zeta + \lambda \\ G_{max} = s_{max} \zeta\end{split}\]
Example Plots
../_images/m012bval_calculation.svg
Raises:
  • ValueError if either both or none of amplitude/bvalue is specified

  • ValueError if specified b-value is not feasible for given system limits

  • ValueError if directions is not broad-castable or matching the length of amplitude/bvalue

Parameters:
  • system_specs (SystemSpec) –

  • lambda – Flat duration of first trapezoidal

  • zeta (Quantity) – Rise time of ramps with maximum slew-rate

  • direction (ndarray) – (3, ) or (n, 3) direction of gradient axis (is normalized internally)

  • amplitude (Optional[Quantity]) – Amplitude in mT/m Either scalar or (n, ) long.

  • bvalue (Optional[Quantity]) – B-Value in (s/mm^2). Either scalar or (n, ) long.

  • start_time (Quantity) – time offset before first lobe (to begin of rise)

  • flip_decoding (bool) – In case of spin-echo sequences, the decoding lobes need to be inverted. If this argument is set to True the inversion is done internally.

  • lambda_ (Quantity) –

Return type:

Union[Sequence, List[Sequence]]

Returns:

Sequence or list of Sequence containing the waveform per specified bvalues

shortest_m012(system_specs, direction, bvalues, start_time=<Quantity(0.0, 'millisecond')>, flip_decoding=False)#

Finds the shortest possible second order motion compensated diffusion weighting gradient waveform according to Stoeck et al. (DOI: 10.1002/mrm.25784).

Compare cmrseq.seqdefs.diffusion.m012 for more information

Parameters:
  • system_specs (SystemSpec) –

  • direction (ndarray) –

  • bvalues (Quantity) –

  • start_time (Quantity) –

  • flip_decoding (bool) –

Return type:

Sequence

Returns: