ImageValidationMixin¶
giant.image_processing.utilities.image_validation_mixin
:
- class giant.image_processing.utilities.image_validation_mixin.ImageValidationMixin(*args, **kwargs)[source]¶
A mixin class that provides functionality for validating and converting image data types.
This mixin is designed to be used with image processing classes that require specific data types for their input images. It ensures that the input image is of an allowed data type before processing, and converts it if necessary.
- Attributes:
- allowed_dtypes (list[DTypeLike]): A list of allowed data types for the image.
This must be implemented by subclasses.
- Methods:
- _validate_and_convert_image: Checks if an image is of an allowed dtype
and converts it if not.
- allowed_dtypes: list[type[Any] | dtype[Any] | _SupportsDType[dtype[Any]] | tuple[Any, Any] | list[Any] | _DTypeDict | str | None]¶
A list of dtypes allowed by the detector.
This must be implemented by subclasses.
Summary of Methods