From 1711484043946cc50647d8de2138005bd8013697 Mon Sep 17 00:00:00 2001 From: thibaultdvx Date: Fri, 27 Dec 2024 16:45:45 +0100 Subject: [PATCH] add ToCanonical --- clinicadl/transforms/config/enum.py | 1 + clinicadl/transforms/config/factory.py | 1 + clinicadl/transforms/config/spatial.py | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/clinicadl/transforms/config/enum.py b/clinicadl/transforms/config/enum.py index c081ac8d5..8072d261c 100644 --- a/clinicadl/transforms/config/enum.py +++ b/clinicadl/transforms/config/enum.py @@ -24,6 +24,7 @@ class ImplementedTransform(str, BaseEnum): Z_NORMALIZATION = "ZNormalization" MASK = "Mask" CROP_OR_PAD = "CropOrPad" + TO_CANONICAL = "ToCanonical" CLAMP = "Clamp" RESAMPLE = "Resample" RESIZE = "Resize" diff --git a/clinicadl/transforms/config/factory.py b/clinicadl/transforms/config/factory.py index 3a0d9d5e5..99745034c 100644 --- a/clinicadl/transforms/config/factory.py +++ b/clinicadl/transforms/config/factory.py @@ -28,6 +28,7 @@ PadConfig, ResampleConfig, ResizeConfig, + ToCanonicalConfig, ) from .spatial_augmentations import ( RandomAffineConfig, diff --git a/clinicadl/transforms/config/spatial.py b/clinicadl/transforms/config/spatial.py index 63c7a8430..7fac9a22c 100644 --- a/clinicadl/transforms/config/spatial.py +++ b/clinicadl/transforms/config/spatial.py @@ -18,6 +18,7 @@ __all__ = [ "CropOrPadConfig", + "ToCanonicalConfig", "ResizeConfig", "ResampleConfig", "EnsureShapeMultipleConfig", @@ -66,6 +67,16 @@ def check_shape(self): return self +class ToCanonicalConfig(TransformConfig): + """Config class for ToCanonical transform.""" + + @computed_field + @property + def name(self) -> ImplementedTransform: + """The name of the transform.""" + return ImplementedTransform.TO_CANONICAL + + class ResizeConfig(TransformConfig): """Config class for Resize transform."""