-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When reading the dicom series with LoadImage(pydicom backend) in MONAI transforms, the spacing is recorded incorrectly.
updated when reading dicom series:
MONAI/monai/data/image_reader.py
Line 542 in 02e7b79
| stack_metadata["spacing"] = np.asarray(spacing) |
didn't updated when reading a single pydicom dataset object:
MONAI/monai/data/image_reader.py
Line 634 in 02e7b79
| for key in ["00200037", "00200032", "52009229", "52009230"]: |
MONAI/monai/data/image_reader.py
Line 664 in 02e7b79
| dr, dc = metadata.get("spacing", (1.0, 1.0))[:2] |
To Reproduce
Steps to reproduce the behavior:
- Install the MONAI dev branch.
- Download the attachment dcm file whose md5 is f511acb750076c56ad2d9647dcfe521d, put it in a folder.
- Run
from monai.transforms import LoadImage
loader = LoadImage(reader='pydicomreader')
pydicom_result = loader('./test_data')
print(pydicom_result.affine)
loader = LoadImage(reader='itkreader')
itk_result = loader('./test_data')
print(itk_result.affine)
Expected behavior
pydicom can record spacing correctly when reading a single pydicom dataset object
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working