SpatialJitter#

class tonic.transforms.SpatialJitter(sensor_size: Tuple[int, int, int], var_x: float = 1, var_y: float = 1, sigma_xy: float = 0, clip_outliers: bool = False)[source]#

Changes x/y coordinate for each event by adding samples from a multivariate Gaussian distribution. It with the following properties:

\[ \begin{align}\begin{aligned}mean = [x,y]\\\Sigma = [[var_x, sigma_{xy}],[sigma_{xy}, var_y]]\end{aligned}\end{align} \]

Jittered events that lie outside the focal plane will be dropped if clip_outliers is True.

Parameters:
  • sensor_size (Tuple[int, int, int]) – a 3-tuple of x,y,p for sensor_size

  • var_x (float) – variance for the distribution in the x direction

  • var_y (float) – variance for the distribution in the y direction

  • sigma_xy (float) – changes skewness of distribution, only change if you want shifts along diagonal axis.

  • clip_outliers (bool) – when True, events that have been jittered outside the sensor size will be dropped.