Skip to content

Commit 37d19ed

Browse files
author
staydelight
committed
fix-issue-7557
Signed-off-by: staydelight <[email protected]>
1 parent 1a3da38 commit 37d19ed

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

monai/transforms/io/array.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,7 @@ def __call__(self, img: MetaTensor):
552552
img (MetaTensor): The input image with metadata.
553553
"""
554554
if "saved_to" not in img.meta:
555-
raise KeyError(
556-
"The 'saved_to' key is missing from the image metadata. Ensure SaveImage is configured with savepath_in_metadict=True."
557-
)
555+
raise KeyError("Missing 'saved_to' key in metadata. Check SaveImage savepath_in_metadict.")
558556

559557
input_path = img.meta["filename_or_obj"]
560558
output_path = img.meta["saved_to"]

tests/test_mapping_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def test_mapping_json(self, load_params, filenames, expected_shape, savepath_in_
7272
the_exception = cm.exception
7373
self.assertIsInstance(the_exception.__cause__, KeyError)
7474
self.assertIn(
75-
"The 'saved_to' key is missing from the image metadata. Ensure SaveImage is configured with savepath_in_metadict=True.",
75+
"Missing 'saved_to' key in metadata. Check SaveImage savepath_in_metadict.",
7676
str(the_exception.__cause__),
7777
)
7878

0 commit comments

Comments
 (0)