Phase2PhaseSplittingMaskGenerator

class deepinv.physics.generator.Phase2PhaseSplittingMaskGenerator(tensor_size: Tuple[int], device: device = 'cpu', rng: Generator | None = None)[source]

Bases: BernoulliSplittingMaskGenerator

Phase2Phase splitting mask generator for dynamic data.

To be exclusively used with deepinv.loss.Phase2PhaseLoss. Splits dynamic data (i.e. data of shape (B, C, T, H, W)) into even and odd phases in the T dimension.

Used in Phase2Phase: Respiratory Motion-Resolved Reconstruction of Free-Breathing Magnetic Resonance Imaging Using Deep Learning Without a Ground Truth for Improved Liver Imaging for free-breathing MRI.

If input_mask not passed, a blank input mask is used instead.

Parameters:
  • tensor_size (tuple[int]) – size of the tensor to be masked without batch dimension of shape (C, T, H, W)

  • device (str, torch.device) – device where the tensor is stored (default: ‘cpu’).

  • rng (torch.Generator) – unused.

batch_step(input_mask: Tensor | None = None) dict[source]

Create one batch of splitting mask.

Parameters:

input_mask (torch.Tensor, None) – optional mask to be split. If None, all pixels are considered. If not None, only pixels where mask==1 are considered. Batch dimension should not be included in shape.