Skip to content

Commit a50009e

Browse files
fix idx error
Signed-off-by: Yiheng Wang <[email protected]>
1 parent 984ffbd commit a50009e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

monai/data/image_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,8 @@ def _combine_dicom_series(self, data: Iterable, filenames: Sequence[PathLike]):
599599
stack_array = np.stack(stack_array, axis=-1)
600600
stack_metadata = self._get_meta_dict(first_slice)
601601
stack_metadata["spacing"] = np.asarray(spacing)
602-
if hasattr(slices[-1], "ImagePositionPatient"):
603-
stack_metadata["lastImagePositionPatient"] = np.asarray(slices[-1].ImagePositionPatient)
602+
if hasattr(slices[-1][0], "ImagePositionPatient"):
603+
stack_metadata["lastImagePositionPatient"] = np.asarray(slices[-1][0].ImagePositionPatient)
604604
stack_metadata[MetaKeys.SPATIAL_SHAPE] = shape + (len(slices),)
605605
else:
606606
stack_array = stack_array[0]

0 commit comments

Comments
 (0)