DSB2017
DSB2017 copied to clipboard
TypeError: can only concatenate list (not "MultiValue") to list
If anyone is using pydicom=1.0.2 instead of the older pydicom=0.9.9, you will get an exception during the preprocessing step:
TypeError: can only concatenate list (not "MultiValue") to list
The exception is raised at line 50 of preprocessing/step1.py. You can fix it by replacing the original version of line 50:
return np.array(image, dtype=np.int16), np.array([slices[0].SliceThickness] + slices[0].PixelSpacing, dtype=np.float32)
with this version:
return np.array(image, dtype=np.int16), np.array([slices[0].SliceThickness, slices[0].PixelSpacing[0], slices[0].PixelSpacing[1]], dtype=np.float32)
(The second version of line 50 works with either version of pydicom.)
thank you ~
2018-03-13 12:05 GMT+08:00 Michael E. Palmer [email protected]:
If anyone is using pydicom=1.0.2 instead of the older pydicom=0.9.9, you will get an exception during the preprocessing step:
TypeError: can only concatenate list (not "MultiValue") to list
The exception is raised at line 50 of preprocessing/step1.py. You can fix it by replacing the original version of line 50:
return np.array(image, dtype=np.int16), np.array([slices[0].SliceThickness]
- slices[0].PixelSpacing, dtype=np.float32)
with this version:
return np.array(image, dtype=np.int16), np.array([slices[0].SliceThickness, slices[0].PixelSpacing[0], slices[0].PixelSpacing[1]], dtype=np.float32)
(The second version of line 50 works with either version of pydicom.)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lfz/DSB2017/issues/72, or mute the thread https://github.com/notifications/unsubscribe-auth/AIigQ1TEbHVlXhsySPU3nSEA_V2CQynHks5td0WMgaJpZM4SoDSa .
-- 廖方舟 清华大学医学院 Liao Fangzhou School of Medicine Tsinghua University Beijing 100084 China
thank you very much
Hey mepster,
in which file can I replace the original version of line 50? I can't find any file. Thanks you in advance
thank you!