deepmr.rigid_motion

Contents

deepmr.rigid_motion#

deepmr.rigid_motion(ndims, nframes, degree='moderate', seed=42)[source]#

Generate rigid motion pattern as a Markov Chain process.

Parameters:
  • ndims (int) – Generate 2D (in-plane only) or 3D motion pattern.

  • nframes (int) – Number of motion frames.

  • degree (str | Iterable[float], optional) – Severity of motion. The default is "moderate".

  • seed (int, optional) – Random number generator seed. The default is 42.

Notes

Severity of motion can be specified via the degree argument. This can be a string - accepted values are "subtle", "moderate" and "severe". These corresponds to the following motion ranges:

  • "subtle": maximum rotation 5.0 [deg]; maximum translation 2.0 [mm]

  • "moderate": maximum rotation 10.0 [deg]; maximum translation 8.0 [mm]

  • "severe": maximum rotation 16.0 [deg]; maximum translation 16.0 [mm]

As an alternative, user can specify a tuple of floats, where degree[0] is the maximum rotation in [deg] and degree[1] is the maximum translation in [mm].

Returns:

  • angleX (torch.Tensor) – Rotation about x axis in [deg] of shape (nframes,).

  • angleY (torch.Tensor) – Rotation about y axis in [deg] of shape (nframes,).

  • angleZ (torch.Tensor) – Rotation about z axis in [deg] of shape (nframes,).

  • dx (torch.Tensor) – Translation towards x axis in [mm] of shape (nframes,).

  • dy (torch.Tensor) – Translation towards y axis in [mm] of shape (nframes,).

  • dz (torch.Tensor) – Translation towards z axis in [mm] of shape (nframes,).