Skip to content

xy_flip_model

Pydantic model for the XYFlip transform.

XYFlipModel #

Bases: TransformModel

Pydantic model used to represent XYFlip transformation.

Attributes:

Name Type Description
name Literal['XYFlip']

Name of the transformation.

p float

Probability of applying the transform, by default 0.5.

seed Optional[int]

Seed for the random number generator, by default None.

Source code in src/careamics/config/transformations/xy_flip_model.py
class XYFlipModel(TransformModel):
    """
    Pydantic model used to represent XYFlip transformation.

    Attributes
    ----------
    name : Literal["XYFlip"]
        Name of the transformation.
    p : float
        Probability of applying the transform, by default 0.5.
    seed : Optional[int]
        Seed for the random number generator,  by default None.
    """

    model_config = ConfigDict(
        validate_assignment=True,
    )

    name: Literal["XYFlip"] = "XYFlip"
    flip_x: bool = Field(
        True,
        description="Whether to flip along the X axis.",
    )
    flip_y: bool = Field(
        True,
        description="Whether to flip along the Y axis.",
    )
    p: float = Field(
        0.5,
        description="Probability of applying the transform.",
        ge=0,
        le=1,
    )
    seed: Optional[int] = None