make_random_mask#
- pypulseqpp.make_random_mask()[source]#
Generate a uniform-random Cartesian sampling mask with a calibration region.
mask[y, z]isTruewhen the view(y, z)is acquired. The mask holdsround(n_y * n_z / accel)views: the centred calibration block, and the remainder drawn uniformly without replacement from the other views. If the calibration block alone exceeds that number, the mask is the calibration block.- Parameters:
- Returns:
Boolean support mask of shape
shape. It encodes no acquisition order.- Return type:
- Raises:
ValueError – If the acceleration is not greater than one.
See also
make_poisson_disc_maskvariable-density draw with a minimum distance.
make_caipirinha_maskdeterministic lattice for parallel imaging.
make_linear_orderecho-train ordering of views taken from a mask with
np.argwhereand centred.
Examples
>>> import numpy as np >>> import pypulseqpp as pp >>> mask = pp.make_random_mask((6, 6), 3.0, calib=(2, 2), seed=0) >>> mask.dtype, mask.shape, int(mask.sum()) (dtype('bool'), (6, 6), 12) >>> bool(mask[2:4, 2:4].all()) True
np.argwherelists the acquired views as(y, z)coordinates:>>> np.argwhere(mask)[:4].tolist() [[0, 0], [0, 1], [0, 2], [1, 1]]