From c5ebb0d8333bc11fc0ba34dff14b919b8fc11406 Mon Sep 17 00:00:00 2001 From: "Wei_Chuan, Chiang" Date: Mon, 23 Dec 2024 17:41:02 +0800 Subject: [PATCH] fix casting Signed-off-by: Wei_Chuan, Chiang --- monai/transforms/spatial/array.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monai/transforms/spatial/array.py b/monai/transforms/spatial/array.py index ecd62e8162..f54f76f3bf 100644 --- a/monai/transforms/spatial/array.py +++ b/monai/transforms/spatial/array.py @@ -536,7 +536,7 @@ def __call__( lazy=lazy_, ) if isinstance(data_array, MetaTensor) and "pixdim" in data_array.meta: - data_array = data_array.clone() # type: MetaTensor + data_array = cast(MetaTensor, data_array.clone()) data_array.set_pixdim() if self.recompute_affine and isinstance(data_array, MetaTensor): if lazy_: