make_caipirinha_mask

make_caipirinha_mask#

pypulseqpp.make_caipirinha_mask()[source]#

Generate a CAIPIRINHA lattice sampling mask.

mask[y, z] is True when the view (y, z) is acquired: line y is acquired when y mod ry = 0, and on it partition z when (z - delta * (y // ry)) mod rz = 0. The lattice is anchored at (0, 0) and spreads the aliasing along both phase-encoding directions [1].

Parameters:
  • shape (tuple of int) – Mask shape (n_y, n_z).

  • ry (int) – Undersampling factor along the first axis.

  • rz (int) – Undersampling factor along the second axis.

  • delta (int, default=1) – CAIPIRINHA shift: partitions the lattice is displaced by per acquired line. delta=0 gives a rectangular ry x rz lattice.

Returns:

Boolean support mask of shape shape, with nominal acceleration ry * rz; the finite grid can change the realised factor. It encodes no acquisition order.

Return type:

numpy.ndarray

Raises:

ValueError – If an undersampling factor is below one.

See also

make_cartesian_plane_sampling

the same lattice anchored on the k-space centre, with calibration and partial Fourier.

make_epi_shot_offsets

segmented blipped-CAIPI shot offsets that tile this lattice.

References

Examples

>>> import numpy as np
>>> import pypulseqpp as pp
>>> mask = pp.make_caipirinha_mask((4, 4), 2, 2, delta=1)
>>> mask.astype(int)
array([[1, 0, 1, 0],
       [0, 0, 0, 0],
       [0, 1, 0, 1],
       [0, 0, 0, 0]])
>>> np.argwhere(mask).tolist()
[[0, 0], [0, 2], [2, 1], [2, 3]]