Skip to content

Augmentations

Source

Deprecated.

NORM_AND_SPATIAL_UNION = Annotated[Union[NormalizeConfig, XYFlipConfig, XYRandomRotate90Config], Discriminator('name')] module-attribute

All transforms including normalization.

SPATIAL_TRANSFORMS_UNION = Annotated[Union[XYFlipConfig, XYRandomRotate90Config], Discriminator('name')] module-attribute

Available spatial transforms in CAREamics.

NormalizeConfig

Bases: TransformConfig

Pydantic model used to represent Normalize transformation.

The Normalize transform is a zero mean and unit variance transformation.

Attributes:

  • name (Literal['Normalize']) –

    Name of the transformation.

  • mean (float) –

    Mean value for normalization.

  • std (float) –

    Standard deviation value for normalization.

model_dump(**kwargs)

Return the model as a dictionary.

Parameters:

  • **kwargs

    Pydantic BaseMode model_dump method keyword arguments.

Returns:

  • {str: Any}

    Dictionary representation of the model.

validate_means_stds()

Validate that the means and stds have the same length.

Returns:

  • Self

    The instance of the model.

TransformConfig

Bases: BaseModel

Pydantic model used to represent a transformation.

The model_dump method is overwritten to exclude the name field.

Attributes:

  • name (str) –

    Name of the transformation.

model_dump(**kwargs)

Return the model as a dictionary.

Parameters:

  • **kwargs

    Pydantic BaseMode model_dump method keyword arguments.

Returns:

  • {str: Any}

    Dictionary representation of the model.