SequentialMaskGenerator#

class deepinv.physics.generator.SequentialMaskGenerator(spatial_generator, T, **kwargs)[source]#

Bases: PhysicsGenerator

Let a mask generator generate non-overlapping sequential sampling patterns.

Given a generator that generates static masks (i.e. without a time dimension), split the samples into T time-steps such that the original mask is the temporal union of all resulting time-steps. The resulting mask is “time-resolved” and simulates shot-based acquisition sequences.

Parameters:
  • spatial_generator (BaseMaskGenerator) – static Cartesian mask generator.

  • T (int) – number of time-steps to split the mask into.

step(batch_size=1, seed=None, **kwargs)[source]#

Generate time-resolved sequential mask from the sampling mask.

The \(n\) sampled lines are split in sequential order into chunks of \(\lceil n/T \rceil\) lines i.e. the \(k\)-th sampled line is assigned to time-step \(\lfloor k / \lceil n/T \rceil \rfloor\).

Parameters:
  • batch_size (int) – batch size.

  • seed (int) – optional seed for the random number generator.

Returns:

dictionary with key ‘mask’ of shape (batch_size, C, T, H, W).

Return type:

dict

Examples using SequentialMaskGenerator:#

Motion simulation and motion-compensated reconstruction

Motion simulation and motion-compensated reconstruction