make_poisson_disc_mask

make_poisson_disc_mask#

pypulseqpp.make_poisson_disc_mask()[source]#

Generate a variable-density Poisson-disc Cartesian sampling mask.

mask[y, z] is True when the view (y, z) is acquired. The minimum distance between acquired views grows with the distance r from the k-space centre as 1 + s r; the slope s is found by bisection so that the realised acceleration matches accel within tol. Views are placed by Bridson’s dart throwing [1]. The algorithm is adapted from sigpy.mri.samp.poisson.

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

  • accel (float) – Target acceleration factor, greater than one.

  • calib (tuple of int, default=(0, 0)) – Extent (c_y, c_z) of the fully sampled calibration block: rows n_y // 2 - c_y // 2 to n_y // 2 + (c_y + 1) // 2 - 1, and likewise for columns. It is seeded into the draw, so no other view is placed within the minimum distance of it.

  • seed (int, default=0) – Seed of the random draw. Equal seeds give equal masks.

  • max_attempts (int, default=30) – Bridson candidate attempts per active point.

  • tol (float, default=0.1) – Allowed deviation of the realised acceleration from accel.

  • crop_corner (bool, default=True) – Remove the views whose normalised distance outside the calibration block is at least 1: with no calibration block, the views outside the ellipse inscribed in the grid. The calibration block is kept.

Returns:

Boolean support mask of shape shape. It encodes no acquisition order; make_shuffling_order() is an echo ordering, not a support.

Return type:

numpy.ndarray

Raises:

ValueError – If the acceleration is not greater than one, or the draw cannot reach it within the shape given.

See also

make_cartesian_plane_sampling

Poisson-disc support with calibration and partial Fourier, as coordinate lists (sampling='poisson').

References

Examples

>>> import pypulseqpp as pp
>>> mask = pp.make_poisson_disc_mask((24, 24), 3.0, calib=(6, 6), seed=1)
>>> mask.dtype, mask.shape
(dtype('bool'), (24, 24))
>>> bool(mask[9:15, 9:15].all())
True
>>> again = pp.make_poisson_disc_mask((24, 24), 3.0, calib=(6, 6), seed=1)
>>> bool((again == mask).all())
True