rigid_motion#
- mrtwin.rigid_motion(ndim, nframes, degree='moderate', seed=42)[source]#
Generate rigid motion pattern as a Markov Chain process.
- Parameters:
Notes
Severity of motion can be specified via the
degreeargument. This can be a string - accepted values are"subtle","moderate"and"severe". These corresponds to the following motion ranges:"subtle": maximum rotation5.0 [deg]; maximum translation2.0 [mm]"moderate": maximum rotation10.0 [deg]; maximum translation8.0 [mm]"severe": maximum rotation16.0 [deg]; maximum translation16.0 [mm]
As an alternative, user can specify a tuple of floats, where
degree[0]is the maximum rotation in[deg]anddegree[1]is the maximum translation in[mm].- Returns:
Motion parameters. The number of outputs depend on the value of
ndims.For
ndim == 2:- angleZtnp.ndarray
Rotation about
zaxis in[deg]of shape(nframes,).
- dynp.ndarray
Translation towards
yaxis in[mm]of shape(nframes,).
- dxnp.ndarray
Translation towards
xaxis in[mm]of shape(nframes,).
For
ndim == 3:- angleXnp.ndarray
Rotation about
xaxis in[deg]of shape(nframes,).
- angleYtorch.Tensor
Rotation about
yaxis in[deg]of shape(nframes,).
- angleZtnp.ndarray
Rotation about
zaxis in[deg]of shape(nframes,).
- dznp.ndarray
Translation towards
zaxis in[mm]of shape(nframes,).
- dynp.ndarray
Translation towards
yaxis in[mm]of shape(nframes,).
- dxnp.ndarray
Translation towards
xaxis in[mm]of shape(nframes,).
- Return type:
tuple[np.ndarray]
- Parameters:
Example
>>> from mrtwin import rigid_motion
We can generate a 6-degree rigid motion pattern for 1000 motion states as:
>>> roll, pitch, yaw, dz, dy, dx = rigid_motion(ndim=3, nframes=1000)