diff --git a/monai/data/image_reader.py b/monai/data/image_reader.py index e5ddbf8f33..936d24cced 100644 --- a/monai/data/image_reader.py +++ b/monai/data/image_reader.py @@ -663,7 +663,7 @@ def _get_affine(self, metadata: dict, lps_to_ras: bool = True): # "00200032" is the tag of `ImagePositionPatient` sx, sy, sz = metadata["00200032"]["Value"] # "00280030" is the tag of `PixelSpacing` - spacing = metadata["00280030"]["Value"] + spacing = metadata["00280030"]["Value"] if "00280030" in metadata else (1.0, 1.0) dr, dc = metadata.get("spacing", spacing)[:2] affine[0, 0] = cx * dr affine[0, 1] = rx * dc