Skip to content
Snippets Groups Projects
Commit 18aa3d5a authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

fix loading dicom of 2D images

parent 69f8a7e9
No related branches found
No related tags found
No related merge requests found
......@@ -145,7 +145,12 @@ def to_direction(
:return: dicom header (with values updated) and image according to the desired stacking order
"""
dcm, image = dcm
spacing_between_slices = float(dcm.SpacingBetweenSlices)
try:
spacing_between_slices = float(dcm.SpacingBetweenSlices)
except AttributeError:
return dcm, image
if spacing_between_slices * direction < 0:
dcm.DetectorInformationSequence[0].ImagePositionPatient[2] *= (
image.shape[0] * spacing_between_slices
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment