Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions monai/data/image_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,10 @@ def _get_meta_dict(self, img) -> Dict:

"""
img_meta_dict = img.GetMetaDataDictionary()
meta_dict = {}
for key in img_meta_dict.GetKeys():
if key.startswith("ITK_"):
continue
val = img_meta_dict[key]
meta_dict[key] = np.asarray(val) if type(val).__name__.startswith("itk") else val
meta_dict = {key: img_meta_dict[key] for key in img_meta_dict.GetKeys() if not key.startswith("ITK_")}

if "qto_xyz" in meta_dict and not isinstance(meta_dict["qto_xyz"], np.ndarray):
meta_dict["qto_xyz"] = np.array(meta_dict["qto_xyz"])

meta_dict["spacing"] = np.asarray(img.GetSpacing())
return meta_dict
Expand Down