FlipDiagonal#

class deeptrack.optical.augmentations.FlipDiagonal(p: float | Callable[[...], float] = 0.5, augment: bool | Callable[[...], bool] | None = None, **kwargs)#

Bases: Augmentation

Flip images along the diagonal.

If the input is a ScatteredVolume or ScatteredField, the underlying array is transposed and any “position” metadata is updated accordingly.

Parameters#

p: PropertyLike[float], optional

Probability of performing the flip. Defaults to 0.5.

augment: PropertyLike[bool] | None

Boolean controlling whether the augmentation is applied. If None, the augmentation is performed with probability p.

Methods#

_get_xp(image, xp, augment, **kwargs) -> np.ndarray | torch.Tensor

Abstract method which performs the FlipDiagonal augmentation.

_update_properties(…) -> ScatteredVolume | ScatteredField

Abstract method to update the properties of the scattered volume or field.

Examples#

>>> import deeptrack as dt
>>> particle = dt.PointParticle(intensity=1)
>>> optics = dt.Fluorescence()
>>> image = optics(particle) >> dt.FlipDiagonal(p=1.0)
>>> image.plot();