From c2abf0932f530e77ab851d7d32497496e579c78c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 15:00:02 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- monai/transforms/utility/array.py | 8 ++++---- monai/transforms/utility/dictionary.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/monai/transforms/utility/array.py b/monai/transforms/utility/array.py index fd1c987902..bce96378d6 100644 --- a/monai/transforms/utility/array.py +++ b/monai/transforms/utility/array.py @@ -1072,7 +1072,7 @@ def __call__(self, img: NdarrayOrTensor) -> NdarrayOrTensor: # merge labels 1 (tumor non-enh) and 4 (tumor enh) and 2 (large edema) to WT # label 4 is ET return torch.stack(result, dim=0) if isinstance(img, torch.Tensor) else np.stack(result, axis=0) - + class ConvertToMultiChannelBasedOnBrats23Classes(Transform): """ @@ -1093,8 +1093,8 @@ def __call__(self, img: NdarrayOrTensor) -> NdarrayOrTensor: result = [(img == 1) | (img == 3), (img == 1) | (img == 3) | (img == 2), img == 3] # -> tc, wt, et # merge labels 1 (ncr) and 3 (et) and 2 (ed) to WT return torch.stack(result, dim=0) if isinstance(img, torch.Tensor) else np.stack(result, axis=0) - - + + class ConvertToMultiChannelBasedOnBrats23ClassesNoReg(Transform): """ Convert labels to multi channels based on brats23 classes: @@ -1114,7 +1114,7 @@ def __call__(self, img: NdarrayOrTensor) -> NdarrayOrTensor: result = [(img == 1), (img == 2), (img == 3)] return torch.stack(result, dim=0) if isinstance(img, torch.Tensor) else np.stack(result, axis=0) - + class AddExtremePointsChannel(Randomizable, Transform): """ diff --git a/monai/transforms/utility/dictionary.py b/monai/transforms/utility/dictionary.py index a87944a563..9a7b7e333e 100644 --- a/monai/transforms/utility/dictionary.py +++ b/monai/transforms/utility/dictionary.py @@ -1313,8 +1313,8 @@ def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, N for key in self.key_iterator(d): d[key] = self.converter(d[key]) return d - - + + class ConvertToMultiChannelBasedOnBrats23Classesd(MapTransform): """ Dictionary-based wrapper of :py:class:`monai.transforms.ConvertToMultiChannelBasedOnBrats23Classes`. @@ -1337,8 +1337,8 @@ def __call__(self, data: Mapping[Hashable, NdarrayOrTensor]) -> dict[Hashable, N for key in self.key_iterator(d): d[key] = self.converter(d[key]) return d - - + + class ConvertToMultiChannelBasedOnBrats23ClassesNoRegd(MapTransform): """ Dictionary-based wrapper of :py:class:`monai.transforms.ConvertToMultiChannelBasedOnBratsClasses`.