lfz / DSB2017

The solution of team 'grt123' in DSB2017
MIT License
1.23k stars 420 forks source link

TypeError: can only concatenate list (not "MultiValue") to list #72

Open mepster opened 6 years ago

mepster commented 6 years ago

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.)

lfz commented 6 years ago

thank you ~

2018-03-13 12:05 GMT+08:00 Michael E. Palmer notifications@github.com:

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

lihaossu commented 5 years ago

thank you very much

Jaaazz commented 5 years ago

Hey mepster,

in which file can I replace the original version of line 50? I can't find any file. Thanks you in advance

jiaxu0017 commented 4 years ago

thank you!