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`.