Repository: Project-MONAI/MONAI

Issue:
Remove output_postfix in post transforms
**Is your feature request related to a problem? Please describe.**
As we already have `CopyItems` utility transform, I think we can remove the `output_postfix` parameter in post transforms.
If we need to keep different post transform results, just need to copy to another item in dict.



Discussion:

Resolving patch:
diff --git a/examples/workflows/unet_evaluation_dict.py b/examples/workflows/unet_evaluation_dict.py
--- a/examples/workflows/unet_evaluation_dict.py
+++ b/examples/workflows/unet_evaluation_dict.py
@@ -82,9 +82,9 @@ def main():
 
     val_post_transforms = Compose(
         [
-            Activationsd(keys="pred", output_postfix="act", sigmoid=True),
-            AsDiscreted(keys="pred_act", output_postfix="dis", threshold_values=True),
-            KeepLargestConnectedComponentd(keys="pred_act_dis", applied_labels=[1], output_postfix=None),
+            Activationsd(keys="pred", sigmoid=True),
+            AsDiscreted(keys="pred", threshold_values=True),
+            KeepLargestConnectedComponentd(keys="pred", applied_labels=[1]),
         ]
     )
     val_handlers = [
@@ -93,7 +93,7 @@ def main():
         SegmentationSaver(
             output_dir="./runs/",
             batch_transform=lambda batch: batch["image_meta_dict"],
-            output_transform=lambda output: output["pred_act_dis"],
+            output_transform=lambda output: output["pred"],
         ),
     ]
 
@@ -104,11 +104,9 @@ def main():
         inferer=SlidingWindowInferer(roi_size=(96, 96, 96), sw_batch_size=4, overlap=0.5),
         post_transform=val_post_transforms,
         key_val_metric={
-            "val_mean_dice": MeanDice(
-                include_background=True, output_transform=lambda x: (x["pred_act_dis"], x["label"])
-            )
+            "val_mean_dice": MeanDice(include_background=True, output_transform=lambda x: (x["pred"], x["label"]))
         },
-        additional_metrics={"val_acc": Accuracy(output_transform=lambda x: (x["pred_act_dis"], x["label"]))},
+        additional_metrics={"val_acc": Accuracy(output_transform=lambda x: (x["pred"], x["label"]))},
         val_handlers=val_handlers,
     )
     evaluator.run()
diff --git a/examples/workflows/unet_training_dict.py b/examples/workflows/unet_training_dict.py
--- a/examples/workflows/unet_training_dict.py
+++ b/examples/workflows/unet_training_dict.py
@@ -112,18 +112,16 @@ def main():
 
     val_post_transforms = Compose(
         [
-            Activationsd(keys="pred", output_postfix="act", sigmoid=True),
-            AsDiscreted(keys="pred_act", output_postfix="dis", threshold_values=True),
-            KeepLargestConnectedComponentd(keys="pred_act_dis", applied_labels=[1], output_postfix=None),
+            Activationsd(keys="pred", sigmoid=True),
+            AsDiscreted(keys="pred", threshold_values=True),
+            KeepLargestConnectedComponentd(keys="pred", applied_labels=[1]),
         ]
     )
     val_handlers = [
         StatsHandler(output_transform=lambda x: None),
         TensorBoardStatsHandler(log_dir="./runs/", output_transform=lambda x: None),
         TensorBoardImageHandler(
-            log_dir="./runs/",
-            batch_transform=lambda x: (x["image"], x["label"]),
-            output_transform=lambda x: x["pred_act_dis"],
+            log_dir="./runs/", batch_transform=lambda x: (x["image"], x["label"]), output_transform=lambda x: x["pred"],
         ),
         CheckpointSaver(save_dir="./runs/", save_dict={"net": net}, save_key_metric=True),
     ]
@@ -135,19 +133,17 @@ def main():
         inferer=SlidingWindowInferer(roi_size=(96, 96, 96), sw_batch_size=4, overlap=0.5),
         post_transform=val_post_transforms,
         key_val_metric={
-            "val_mean_dice": MeanDice(
-                include_background=True, output_transform=lambda x: (x["pred_act_dis"], x["label"])
-            )
+            "val_mean_dice": MeanDice(include_background=True, output_transform=lambda x: (x["pred"], x["label"]))
         },
-        additional_metrics={"val_acc": Accuracy(output_transform=lambda x: (x["pred_act_dis"], x["label"]))},
+        additional_metrics={"val_acc": Accuracy(output_transform=lambda x: (x["pred"], x["label"]))},
         val_handlers=val_handlers,
     )
 
     train_post_transforms = Compose(
         [
-            Activationsd(keys="pred", output_postfix="act", sigmoid=True),
-            AsDiscreted(keys="pred_act", output_postfix="dis", threshold_values=True),
-            KeepLargestConnectedComponentd(keys="pred_act_dis", applied_labels=[1], output_postfix=None),
+            Activationsd(keys="pred", sigmoid=True),
+            AsDiscreted(keys="pred", threshold_values=True),
+            KeepLargestConnectedComponentd(keys="pred", applied_labels=[1]),
         ]
     )
     train_handlers = [
@@ -168,7 +164,7 @@ def main():
         inferer=SimpleInferer(),
         amp=False,
         post_transform=train_post_transforms,
-        key_train_metric={"train_acc": Accuracy(output_transform=lambda x: (x["pred_act_dis"], x["label"]))},
+        key_train_metric={"train_acc": Accuracy(output_transform=lambda x: (x["pred"], x["label"]))},
         train_handlers=train_handlers,
     )
     trainer.run()
diff --git a/monai/transforms/post/dictionary.py b/monai/transforms/post/dictionary.py
--- a/monai/transforms/post/dictionary.py
+++ b/monai/transforms/post/dictionary.py
@@ -41,6 +41,7 @@ def __init__(self, keys: KeysCollection, output_postfixes, to_onehot=False, num_
             to_onehot (bool or list of bool): whether to convert the data to One-Hot format, default is False.
             num_classes (int or list of int): the class number used to convert to One-Hot format
                 if `to_onehot` is True.
+
         """
         super().__init__(keys)
         if not isinstance(output_postfixes, (list, tuple)):
@@ -66,26 +67,20 @@ class Activationsd(MapTransform):
     Add activation layers to the input data specified by `keys`.
     """
 
-    def __init__(self, keys: KeysCollection, output_postfix: str = "act", sigmoid=False, softmax=False, other=None):
+    def __init__(self, keys: KeysCollection, sigmoid=False, softmax=False, other=None):
         """
         Args:
             keys: keys of the corresponding items to model output and label.
                 See also: :py:class:`monai.transforms.compose.MapTransform`
-            output_postfix: the postfix string to construct keys to store converted data.
-                for example: if the keys of input data is `pred` and `label`, output_postfix is `act`,
-                the output data keys will be: `pred_act`, `label_act`.
-                if set to None, will replace the original data with the same key.
             sigmoid (bool, tuple or list of bool): whether to execute sigmoid function on model
                 output before transform.
             softmax (bool, tuple or list of bool): whether to execute softmax function on model
                 output before transform.
             other (Callable, tuple or list of Callables): callable function to execute other activation layers,
                 for example: `other = lambda x: torch.tanh(x)`
+
         """
         super().__init__(keys)
-        if output_postfix is not None and not isinstance(output_postfix, str):
-            raise ValueError("output_postfix must be a string.")
-        self.output_postfix = output_postfix
         self.sigmoid = ensure_tuple_rep(sigmoid, len(self.keys))
         self.softmax = ensure_tuple_rep(softmax, len(self.keys))
         self.other = ensure_tuple_rep(other, len(self.keys))
@@ -94,9 +89,7 @@ def __init__(self, keys: KeysCollection, output_postfix: str = "act", sigmoid=Fa
     def __call__(self, data):
         d = dict(data)
         for idx, key in enumerate(self.keys):
-            ret = self.converter(d[key], self.sigmoid[idx], self.softmax[idx], self.other[idx])
-            output_key = key if self.output_postfix is None else f"{key}_{self.output_postfix}"
-            d[output_key] = ret
+            d[key] = self.converter(d[key], self.sigmoid[idx], self.softmax[idx], self.other[idx])
         return d
 
 
@@ -108,7 +101,6 @@ class AsDiscreted(MapTransform):
     def __init__(
         self,
         keys: KeysCollection,
-        output_postfix: str = "discreted",
         argmax: bool = False,
         to_onehot: bool = False,
         n_classes: Optional[int] = None,
@@ -119,20 +111,14 @@ def __init__(
         Args:
             keys: keys of the corresponding items to model output and label.
                 See also: :py:class:`monai.transforms.compose.MapTransform`
-            output_postfix: the postfix string to construct keys to store converted data.
-                for example: if the keys of input data is `pred` and `label`, output_postfix is `discreted`,
-                the output data keys will be: `pred_discreted`, `label_discreted`.
-                if set to None, will replace the original data with the same key.
             argmax: whether to execute argmax function on input data before transform.
             to_onehot: whether to convert input data into the one-hot format. Defaults to False.
             n_classes: the number of classes to convert to One-Hot format.
             threshold_values: whether threshold the float value to int number 0 or 1, default is False.
             logit_thresh: the threshold value for thresholding operation, default is 0.5.
+
         """
         super().__init__(keys)
-        if output_postfix is not None and not isinstance(output_postfix, str):
-            raise ValueError("output_postfix must be a string.")
-        self.output_postfix = output_postfix
         self.argmax = ensure_tuple_rep(argmax, len(self.keys))
         self.to_onehot = ensure_tuple_rep(to_onehot, len(self.keys))
         self.n_classes = ensure_tuple_rep(n_classes, len(self.keys))
@@ -143,8 +129,7 @@ def __init__(
     def __call__(self, data):
         d = dict(data)
         for idx, key in enumerate(self.keys):
-            output_key = key if self.output_postfix is None else f"{key}_{self.output_postfix}"
-            d[output_key] = self.converter(
+            d[key] = self.converter(
                 d[key],
                 self.argmax[idx],
                 self.to_onehot[idx],
@@ -181,22 +166,15 @@ def __init__(
             connectivity: Maximum number of orthogonal hops to consider a pixel/voxel as a neighbor.
                 Accepted values are ranging from  1 to input.ndim. If ``None``, a full
                 connectivity of ``input.ndim`` is used.
-            output_postfix: the postfix string to construct keys to store converted data.
-                for example: if the keys of input data is `label`, output_postfix is `largestcc`,
-                the output data keys will be: `label_largestcc`.
-                if set to None, will replace the original data with the same key.
+
         """
         super().__init__(keys)
-        if output_postfix is not None and not isinstance(output_postfix, str):
-            raise ValueError("output_postfix must be a string.")
-        self.output_postfix = output_postfix
         self.converter = KeepLargestConnectedComponent(applied_labels, independent, connectivity)
 
     def __call__(self, data):
         d = dict(data)
         for idx, key in enumerate(self.keys):
-            output_key = key if self.output_postfix is None else f"{key}_{self.output_postfix}"
-            d[output_key] = self.converter(d[key])
+            d[key] = self.converter(d[key])
         return d
 
 


Test patch:
diff --git a/tests/test_activationsd.py b/tests/test_activationsd.py
--- a/tests/test_activationsd.py
+++ b/tests/test_activationsd.py
@@ -15,40 +15,27 @@
 from monai.transforms import Activationsd
 
 TEST_CASE_1 = [
-    {"keys": ["pred", "label"], "output_postfix": "act", "sigmoid": False, "softmax": [True, False], "other": None},
+    {"keys": ["pred", "label"], "sigmoid": False, "softmax": [True, False], "other": None},
     {"pred": torch.tensor([[[[0.0, 1.0]], [[2.0, 3.0]]]]), "label": torch.tensor([[[[0.0, 1.0]], [[2.0, 3.0]]]])},
     {
-        "pred_act": torch.tensor([[[[0.1192, 0.1192]], [[0.8808, 0.8808]]]]),
-        "label_act": torch.tensor([[[[0.0, 1.0]], [[2.0, 3.0]]]]),
+        "pred": torch.tensor([[[[0.1192, 0.1192]], [[0.8808, 0.8808]]]]),
+        "label": torch.tensor([[[[0.0, 1.0]], [[2.0, 3.0]]]]),
     },
     (1, 2, 1, 2),
 ]
 
 TEST_CASE_2 = [
-    {
-        "keys": ["pred", "label"],
-        "output_postfix": "act",
-        "sigmoid": False,
-        "softmax": False,
-        "other": [lambda x: torch.tanh(x), None],
-    },
+    {"keys": ["pred", "label"], "sigmoid": False, "softmax": False, "other": [lambda x: torch.tanh(x), None]},
     {"pred": torch.tensor([[[[0.0, 1.0], [2.0, 3.0]]]]), "label": torch.tensor([[[[0.0, 1.0], [2.0, 3.0]]]])},
     {
-        "pred_act": torch.tensor([[[[0.0000, 0.7616], [0.9640, 0.9951]]]]),
-        "label_act": torch.tensor([[[[0.0, 1.0], [2.0, 3.0]]]]),
+        "pred": torch.tensor([[[[0.0000, 0.7616], [0.9640, 0.9951]]]]),
+        "label": torch.tensor([[[[0.0, 1.0], [2.0, 3.0]]]]),
     },
     (1, 1, 2, 2),
 ]
 
 TEST_CASE_3 = [
-    {"keys": "pred", "output_postfix": "act", "sigmoid": False, "softmax": False, "other": lambda x: torch.tanh(x)},
-    {"pred": torch.tensor([[[[0.0, 1.0], [2.0, 3.0]]]])},
-    {"pred_act": torch.tensor([[[[0.0000, 0.7616], [0.9640, 0.9951]]]])},
-    (1, 1, 2, 2),
-]
-
-TEST_CASE_4 = [
-    {"keys": "pred", "output_postfix": None, "sigmoid": False, "softmax": False, "other": lambda x: torch.tanh(x)},
+    {"keys": "pred", "sigmoid": False, "softmax": False, "other": lambda x: torch.tanh(x)},
     {"pred": torch.tensor([[[[0.0, 1.0], [2.0, 3.0]]]])},
     {"pred": torch.tensor([[[[0.0000, 0.7616], [0.9640, 0.9951]]]])},
     (1, 1, 2, 2),
@@ -58,18 +45,12 @@
 class TestActivationsd(unittest.TestCase):
     @parameterized.expand([TEST_CASE_1, TEST_CASE_2, TEST_CASE_3])
     def test_value_shape(self, input_param, test_input, output, expected_shape):
-        result = Activationsd(**input_param)(test_input)
-        torch.testing.assert_allclose(result["pred_act"], output["pred_act"])
-        self.assertTupleEqual(result["pred_act"].shape, expected_shape)
-        if "label_act" in result:
-            torch.testing.assert_allclose(result["label_act"], output["label_act"])
-            self.assertTupleEqual(result["label_act"].shape, expected_shape)
-
-    @parameterized.expand([TEST_CASE_4])
-    def test_none_postfix(self, input_param, test_input, output, expected_shape):
         result = Activationsd(**input_param)(test_input)
         torch.testing.assert_allclose(result["pred"], output["pred"])
         self.assertTupleEqual(result["pred"].shape, expected_shape)
+        if "label" in result:
+            torch.testing.assert_allclose(result["label"], output["label"])
+            self.assertTupleEqual(result["label"].shape, expected_shape)
 
 
 if __name__ == "__main__":
diff --git a/tests/test_as_discreted.py b/tests/test_as_discreted.py
--- a/tests/test_as_discreted.py
+++ b/tests/test_as_discreted.py
@@ -17,7 +17,6 @@
 TEST_CASE_1 = [
     {
         "keys": ["pred", "label"],
-        "output_postfix": "discrete",
         "argmax": [True, False],
         "to_onehot": True,
         "n_classes": 2,
@@ -25,17 +24,13 @@
         "logit_thresh": 0.5,
     },
     {"pred": torch.tensor([[[[0.0, 1.0]], [[2.0, 3.0]]]]), "label": torch.tensor([[[[0, 1]]]])},
-    {
-        "pred_discrete": torch.tensor([[[[0.0, 0.0]], [[1.0, 1.0]]]]),
-        "label_discrete": torch.tensor([[[[1.0, 0.0]], [[0.0, 1.0]]]]),
-    },
+    {"pred": torch.tensor([[[[0.0, 0.0]], [[1.0, 1.0]]]]), "label": torch.tensor([[[[1.0, 0.0]], [[0.0, 1.0]]]])},
     (1, 2, 1, 2),
 ]
 
 TEST_CASE_2 = [
     {
         "keys": ["pred", "label"],
-        "output_postfix": "discrete",
         "argmax": False,
         "to_onehot": False,
         "n_classes": None,
@@ -43,32 +38,13 @@
         "logit_thresh": 0.6,
     },
     {"pred": torch.tensor([[[[0.0, 1.0], [2.0, 3.0]]]]), "label": torch.tensor([[[[0, 1], [1, 1]]]])},
-    {
-        "pred_discrete": torch.tensor([[[[0.0, 1.0], [1.0, 1.0]]]]),
-        "label_discrete": torch.tensor([[[[0.0, 1.0], [1.0, 1.0]]]]),
-    },
+    {"pred": torch.tensor([[[[0.0, 1.0], [1.0, 1.0]]]]), "label": torch.tensor([[[[0.0, 1.0], [1.0, 1.0]]]])},
     (1, 1, 2, 2),
 ]
 
 TEST_CASE_3 = [
     {
         "keys": ["pred"],
-        "output_postfix": "discrete",
-        "argmax": True,
-        "to_onehot": True,
-        "n_classes": 2,
-        "threshold_values": False,
-        "logit_thresh": 0.5,
-    },
-    {"pred": torch.tensor([[[[0.0, 1.0]], [[2.0, 3.0]]]])},
-    {"pred_discrete": torch.tensor([[[[0.0, 0.0]], [[1.0, 1.0]]]])},
-    (1, 2, 1, 2),
-]
-
-TEST_CASE_4 = [
-    {
-        "keys": "pred",
-        "output_postfix": None,
         "argmax": True,
         "to_onehot": True,
         "n_classes": 2,
@@ -84,18 +60,12 @@
 class TestAsDiscreted(unittest.TestCase):
     @parameterized.expand([TEST_CASE_1, TEST_CASE_2, TEST_CASE_3])
     def test_value_shape(self, input_param, test_input, output, expected_shape):
-        result = AsDiscreted(**input_param)(test_input)
-        torch.testing.assert_allclose(result["pred_discrete"], output["pred_discrete"])
-        self.assertTupleEqual(result["pred_discrete"].shape, expected_shape)
-        if "label_discrete" in result:
-            torch.testing.assert_allclose(result["label_discrete"], output["label_discrete"])
-            self.assertTupleEqual(result["label_discrete"].shape, expected_shape)
-
-    @parameterized.expand([TEST_CASE_4])
-    def test_none_postfix(self, input_param, test_input, output, expected_shape):
         result = AsDiscreted(**input_param)(test_input)
         torch.testing.assert_allclose(result["pred"], output["pred"])
         self.assertTupleEqual(result["pred"].shape, expected_shape)
+        if "label" in result:
+            torch.testing.assert_allclose(result["label"], output["label"])
+            self.assertTupleEqual(result["label"].shape, expected_shape)
 
 
 if __name__ == "__main__":
diff --git a/tests/test_integration_workflows.py b/tests/test_integration_workflows.py
--- a/tests/test_integration_workflows.py
+++ b/tests/test_integration_workflows.py
@@ -103,18 +103,16 @@ def run_training_test(root_dir, device=torch.device("cuda:0")):
 
     val_post_transforms = Compose(
         [
-            Activationsd(keys="pred", output_postfix="act", sigmoid=True),
-            AsDiscreted(keys="pred_act", output_postfix="dis", threshold_values=True),
-            KeepLargestConnectedComponentd(keys="pred_act_dis", applied_labels=[1], output_postfix=None),
+            Activationsd(keys="pred", sigmoid=True),
+            AsDiscreted(keys="pred", threshold_values=True),
+            KeepLargestConnectedComponentd(keys="pred", applied_labels=[1]),
         ]
     )
     val_handlers = [
         StatsHandler(output_transform=lambda x: None),
         TensorBoardStatsHandler(log_dir=root_dir, output_transform=lambda x: None),
         TensorBoardImageHandler(
-            log_dir=root_dir,
-            batch_transform=lambda x: (x["image"], x["label"]),
-            output_transform=lambda x: x["pred_act_dis"],
+            log_dir=root_dir, batch_transform=lambda x: (x["image"], x["label"]), output_transform=lambda x: x["pred"],
         ),
         CheckpointSaver(save_dir=root_dir, save_dict={"net": net}, save_key_metric=True),
     ]
@@ -126,19 +124,17 @@ def run_training_test(root_dir, device=torch.device("cuda:0")):
         inferer=SlidingWindowInferer(roi_size=(96, 96, 96), sw_batch_size=4, overlap=0.5),
         post_transform=val_post_transforms,
         key_val_metric={
-            "val_mean_dice": MeanDice(
-                include_background=True, output_transform=lambda x: (x["pred_act_dis"], x["label"])
-            )
+            "val_mean_dice": MeanDice(include_background=True, output_transform=lambda x: (x["pred"], x["label"]))
         },
-        additional_metrics={"val_acc": Accuracy(output_transform=lambda x: (x["pred_act_dis"], x["label"]))},
+        additional_metrics={"val_acc": Accuracy(output_transform=lambda x: (x["pred"], x["label"]))},
         val_handlers=val_handlers,
     )
 
     train_post_transforms = Compose(
         [
-            Activationsd(keys="pred", output_postfix="act", sigmoid=True),
-            AsDiscreted(keys="pred_act", output_postfix="dis", threshold_values=True),
-            KeepLargestConnectedComponentd(keys="pred_act_dis", applied_labels=[1], output_postfix=None),
+            Activationsd(keys="pred", sigmoid=True),
+            AsDiscreted(keys="pred", threshold_values=True),
+            KeepLargestConnectedComponentd(keys="pred", applied_labels=[1]),
         ]
     )
     train_handlers = [
@@ -159,7 +155,7 @@ def run_training_test(root_dir, device=torch.device("cuda:0")):
         inferer=SimpleInferer(),
         amp=False,
         post_transform=train_post_transforms,
-        key_train_metric={"train_acc": Accuracy(output_transform=lambda x: (x["pred_act_dis"], x["label"]))},
+        key_train_metric={"train_acc": Accuracy(output_transform=lambda x: (x["pred"], x["label"]))},
         train_handlers=train_handlers,
     )
     trainer.run()
@@ -198,9 +194,9 @@ def run_inference_test(root_dir, model_file, device=torch.device("cuda:0")):
 
     val_post_transforms = Compose(
         [
-            Activationsd(keys="pred", output_postfix="act", sigmoid=True),
-            AsDiscreted(keys="pred_act", output_postfix="dis", threshold_values=True),
-            KeepLargestConnectedComponentd(keys="pred_act_dis", applied_labels=[1], output_postfix=None),
+            Activationsd(keys="pred", sigmoid=True),
+            AsDiscreted(keys="pred", threshold_values=True),
+            KeepLargestConnectedComponentd(keys="pred", applied_labels=[1]),
         ]
     )
     val_handlers = [
@@ -209,7 +205,7 @@ def run_inference_test(root_dir, model_file, device=torch.device("cuda:0")):
         SegmentationSaver(
             output_dir=root_dir,
             batch_transform=lambda batch: batch["image_meta_dict"],
-            output_transform=lambda output: output["pred_act_dis"],
+            output_transform=lambda output: output["pred"],
         ),
     ]
 
@@ -220,11 +216,9 @@ def run_inference_test(root_dir, model_file, device=torch.device("cuda:0")):
         inferer=SlidingWindowInferer(roi_size=(96, 96, 96), sw_batch_size=4, overlap=0.5),
         post_transform=val_post_transforms,
         key_val_metric={
-            "val_mean_dice": MeanDice(
-                include_background=True, output_transform=lambda x: (x["pred_act_dis"], x["label"])
-            )
+            "val_mean_dice": MeanDice(include_background=True, output_transform=lambda x: (x["pred"], x["label"]))
         },
-        additional_metrics={"val_acc": Accuracy(output_transform=lambda x: (x["pred_act_dis"], x["label"]))},
+        additional_metrics={"val_acc": Accuracy(output_transform=lambda x: (x["pred"], x["label"]))},
         val_handlers=val_handlers,
     )
     evaluator.run()
diff --git a/tests/test_keep_largest_connected_componentd.py b/tests/test_keep_largest_connected_componentd.py
--- a/tests/test_keep_largest_connected_componentd.py
+++ b/tests/test_keep_largest_connected_componentd.py
@@ -425,13 +425,6 @@
     ),
 ]
 
-TEST_CASE_18 = [
-    "none_postfix",
-    {"keys": ["img"], "output_postfix": None, "independent": False, "applied_labels": [1]},
-    grid_1,
-    torch.tensor([[[[0, 0, 1, 0, 0], [0, 2, 1, 1, 1], [0, 2, 1, 0, 0], [0, 2, 0, 1, 0], [2, 2, 0, 0, 2]]]]),
-]
-
 VALID_CASES = [
     TEST_CASE_1,
     TEST_CASE_2,
@@ -477,10 +470,10 @@ def test_correct_results(self, _, args, input_dict, expected):
         if torch.cuda.is_available():
             input_dict["img"] = input_dict["img"].cuda()
             result = converter(input_dict)
-            torch.allclose(result["img_largestcc"], expected.cuda())
+            torch.allclose(result["img"], expected.cuda())
         else:
             result = converter(input_dict)
-            torch.allclose(result["img_largestcc"], expected)
+            torch.allclose(result["img"], expected)
 
     @parameterized.expand(INVALID_CASES)
     def test_raise_exception(self, _, args, input_dict, expected_error):
@@ -490,13 +483,6 @@ def test_raise_exception(self, _, args, input_dict, expected_error):
                 input_dict["img"] = input_dict["img"].cuda()
             _ = converter(input_dict)
 
-    @parameterized.expand([TEST_CASE_18])
-    def test_none_postfix(self, _, args, input_dict, expected):
-        converter = KeepLargestConnectedComponentd(**args)
-        input_dict["img"] = input_dict["img"].cpu()
-        result = converter(input_dict)
-        torch.allclose(result["img"], expected)
-
 
 if __name__ == "__main__":
     unittest.main()