EquispacedMaskGenerator#
- class deepinv.physics.generator.EquispacedMaskGenerator(img_size, acceleration=4, center_fraction=None, rng=None, device='cpu', *args, **kwargs)[source]#
Bases:
BaseMaskGenerator
Generator for MRI Cartesian acceleration masks using uniform (equispaced) non-random undersampling with random offset.
Generate a mask of vertical lines for MRI acceleration with fixed sampling in low frequencies (center of k-space) and equispaced undersampling in the high frequencies.
The number of lines selected with equal spacing are at a proportion that reaches the desired acceleration rate taking into consideration the number of low-freq lines, so that the total number of lines is (N / acceleration).
Supports k-t sampling, where the uniform mask is sheared across time.
The mask is repeated across channels and the offset varies randomly across batch dimension. Based off fastMRI code facebookresearch/fastMRI
For parameter descriptions see
deepinv.physics.generator.mri.BaseMaskGenerator
- Examples:
Equispaced k-t mask generator for a 8x64x64 video:
>>> from deepinv.physics.generator import EquispacedMaskGenerator >>> generator = EquispacedMaskGenerator((2, 8, 64, 64), acceleration=8, center_fraction=0.04) # C, T, H, W >>> params = generator.step(batch_size=1) >>> mask = params["mask"] >>> mask.shape torch.Size([1, 2, 8, 64, 64])