delta.data.data_augmentation

delta.data.data_augmentation(images_input: List[ndarray[Any, dtype[Any]]], aug_par: Dict[str, Any], order: Union[int, List[int], Tuple[int, ...]] = 0, time: Union[int, List[int]] = 0) List[ndarray[Any, dtype[Any]]]

Data augmentation function

Parameters
images_inputlist of 2D numpy arrays

Images to apply augmentation operations to.

aug_pardict
Augmentation operations parameters. Accepted key-value pairs:
illumination_voodoo: bool.

Whether to apply the illumination voodoo operation.

histogram_voodoo: bool.

Whether to apply the histogram voodoo operation.

elastic_deformation: dict.

If key exists, the elastic deformation operation is applied. The parameters are given as key-value pairs. sigma values are given under the sigma key, deformation points are given under the points key. See elasticdeform doc.

gaussian_noise: float.

Apply gaussian noise to the image. The sigma value of the gaussian noise is uniformly sampled between 0 and +gaussian_noise.

gaussain_blur: float.

Apply gaussian blur to the image. The sigma value is the standard deviation of the kernel in the x and y direction.

horizontal_flip: bool.

Whether to flip the images horizontally. Input images have a 50% chance of being flipped

vertical_flip: bool.

Whether to flip the images vertically. Input images have a 50% chance of being flipped

rotations90d: bool.

Whether to randomly rotate the images in 90° increments. Each 90° rotation has a 25% chance of happening

rotation: int or float.

Range of random rotation to apply. The angle is uniformly sampled in the range [-rotation, +rotation]

zoom: float.

Range of random “zoom” to apply. The image is randomly zoomed by a factor that is sampled from an exponential distribution with a lamba of 3/zoom. The random factor is clipped at +zoom.

shiftX: int/float.

The range of random shifts to apply along X. A uniformly sampled shift between [-shiftX, +shiftX] is applied

shiftY: int/float.

The range of random shifts to apply along Y. A uniformly sampled shift between [-shiftY, +shiftY] is applied

Note that the same operations are applied to all inputs except for the timeshift ones.

orderint or list/tuple of ints, optional

Interpolation order to use for each image in the input stack. If order is a scalar, the same order is applied to all images. If a list of orders is provided, each image in the stack will have its own operaiton order. See skimage.transform.wrap doc. Note that the histogram voodoo operation is only applied to images with a non-zero order. The default is 0.

timeint or list of ints, optional

Timepoint of each input. If a list is provided, inputs belonging to the same timepoint (e.g. 0 for previous timepoint images and 1 for current) will be treated the same in time-related transformations (e.g. timeshift, where current frames are shifted relative to previous frames)

Returns
outputlist of 2D numpy arrays

Augmented images array.