tonic.functional.spatial_jitter#

Module Contents#

Functions#

spatial_jitter_numpy(events, sensor_size[, var_x, ...])

Changes x/y coordinate for each event by adding samples from a multivariate Gaussian

tonic.functional.spatial_jitter.spatial_jitter_numpy(events: numpy.ndarray, sensor_size: List[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:
  • events (numpy.ndarray) – ndarray of shape [num_events, num_event_channels]

  • var_x (float) – squared sigma value for the distribution in the x direction

  • var_y (float) – squared sigma value 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.

  • sensor_size (List[int]) –

Returns:

array of spatially jittered events.