Skip to content

Commit

Permalink
Some DICOM values are empty/None
Browse files Browse the repository at this point in the history
Match the behavior of GDCM and set the field to an empty string.
  • Loading branch information
blowekamp committed Dec 19, 2023
1 parent 8550cf9 commit 2db0e40
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rap_sitkcore/read_dcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def _read_dcm_pydicom(filename: Path) -> sitk.Image:
if tag in ds:
de = ds.data_element(tag)
key = f"{de.tag.group:04x}|{de.tag.elem:04x}"
if de.VR == "DS":
if de.value is None:
img[key] = ""
elif de.VR == "DS":
if de.VM > 1:
img[key] = convert_float_list_to_mv_ds(de.value)
else:
Expand Down

0 comments on commit 2db0e40

Please sign in to comment.