danishm / mritopng

A simple python module to make it easy to batch convert DICOM files to PNG images.
MIT License
137 stars 48 forks source link

On the conversion of DICOM convert PNG the problem of error #5

Closed yyyamada closed 6 years ago

yyyamada commented 6 years ago

Hello, I am Leon. I am lucky with you in GitHub upload on DICOM convert PNG code. And the success of a part of the DICOM file convert PNG file. But there is a part of the DICOM file cannot be converted to PNG files, the error code is as follows:

FAIL: /home/imi/Downloads/caffe-master/examples/luna/test_images/000013.dcm --> /home/imi/Downloads/caffe-master/examples/luna/xxx2/./000013.dcm.png : unsigned byte integer is less than minimum

FAIL: /home/imi/Downloads/caffe-master/examples/luna/test_images/000017.dcm --> /home/imi/Downloads/caffe-master/examples/luna/xxx2/./000017.dcm.png : unsigned byte integer is less than minimum

FAIL: /home/imi/Downloads/caffe-master/examples/luna/test_images/000012.dcm --> /home/imi/Downloads/caffe-master/examples/luna/xxx2/./000012.dcm.png : unsigned byte integer is less than minimum

SUCCESS: /home/imi/Downloads/caffe-master/examples/luna/test_images/000002.dcm --> /home/imi/Downloads/caffe-master/examples/luna/xxx2/./000002.dcm.png

At the same time we also show:plan.pixel_array code

[[-1024 -1024 -1024 ..., -1024 -1024 -1024] [-1024 -1024 -1024 ..., -1024 -1024 -1024] [-1024 -1024 -1024 ..., -1024 -1024 -1024] ..., [-1024 -1024 -1024 ..., -1024 -1024 -1024] [-1024 -1024 -1024 ..., -1024 -1024 -1024] [-1024 -1024 -1024 ..., -1024 -1024 -1024]] FAIL: /home/imi/Downloads/caffe-master/examples/luna/test_images/000013.dcm --> /home/imi/Downloads/caffe-master/examples/luna/xxx2/./000013.dcm.png : unsigned byte integer is less than minimum

[[-1024 -1024 -1024 ..., -1024 -1024 -1024] [-1024 -1024 -1024 ..., -1024 -1024 -1024] [-1024 -1024 -1024 ..., -1024 -1024 -1024] ..., [-1024 -1024 -1024 ..., -1024 -1024 -1024] [-1024 -1024 -1024 ..., -1024 -1024 -1024] [-1024 -1024 -1024 ..., -1024 -1024 -1024]] FAIL: /home/imi/Downloads/caffe-master/examples/luna/test_images/000017.dcm --> /home/imi/Downloads/caffe-master/examples/luna/xxx2/./000017.dcm.png : unsigned byte integer is less than minimum

[[-2000 -2000 -2000 ..., -2000 -2000 -2000] [-2000 -2000 -2000 ..., -2000 -2000 -2000] [-2000 -2000 -2000 ..., -2000 -2000 -2000] ..., [-2000 -2000 -2000 ..., -2000 -2000 -2000] [-2000 -2000 -2000 ..., -2000 -2000 -2000] [-2000 -2000 -2000 ..., -2000 -2000 -2000]] FAIL: /home/imi/Downloads/caffe-master/examples/luna/test_images/000012.dcm --> /home/imi/Downloads/caffe-master/examples/luna/xxx2/./000012.dcm.png : unsigned byte integer is less than minimum

[[18 33 13 ..., 23 22 20] [18 41 25 ..., 6 18 21] [ 4 12 35 ..., 17 24 29] ..., [34 17 15 ..., 13 10 17] [44 18 14 ..., 16 15 15] [28 23 20 ..., 17 5 18]] SUCCESS: /home/imi/Downloads/caffe-master/examples/luna/test_images/000002.dcm --> /home/imi/Downloads/caffe-master/examples/luna/xxx2/./000002.dcm.png

We cannot find the relevant information on the Internet, so I hope to get your help. Thank you

danishm commented 6 years ago

Hi Leon,

Thank you for appreciating the tool! Could you please share the files that are causing problems? OR are they part of a public dataset, which I can go to?

yyyamada commented 6 years ago

than you this is my dicom link:https://1drv.ms/f/s!AjRAh5TG2toPlRpoAMBQRqJ5shyu

danishm commented 6 years ago

Thank you @yyyamada, I'm working on a fix!

danishm commented 6 years ago

@yyyamada This issue should be fixed in the 2.1 release. Hence, pulling the latest master should contain this fix.

Please let me know it this worked for you so that I can close this issue

yyyamada commented 6 years ago

Thank you very much. Now my files are basically successful!