Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mepster opened this issue Mar 13, 2018 · 4 comments
Open

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

mepster opened this issue Mar 13, 2018 · 4 comments

Comments

@mepster
Copy link

mepster commented Mar 13, 2018

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
Copy link
Owner

lfz commented Mar 13, 2018 via email

@lihaossu
Copy link

thank you very much

@Jaaazz
Copy link

Jaaazz commented Dec 3, 2018

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
Copy link

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants