bastula / dicompyler

Extensible radiation therapy research platform and viewer for DICOM and DICOM RT
http://www.dicompyler.com
268 stars 100 forks source link

Crashed when character cannot encoded in meta inforation #119

Open JeffreySu opened 5 years ago

JeffreySu commented 5 years ago

I have a set of .dcm with patient's Chinese name, I can read it out in other applications (even though some of them display messy code) ,but when I try to open it in dicompyler, it seems not supported to fault-tolerant the uncodified character.

When I use Open Quick to open just one .dcm it's OK, but when I use Open Patient, it crashed.

Information in Error window as following:

Platform information:
System: Windows
Version: ('post2008Server', '6.2.9200', '', u'Multiprocessor Free')
Python Version: 2.6.6
dicompyler Version: 0.4.2

dicompyler.dicomgui: DEBUG: Reading: E:\ct\lxj\143.dcm
dicompyler.dicomgui: DEBUG: Reading:E:\ct\lxj\144.dcm
dicompyler.dicomgui: DEBUG: Reading:E:\ct\lxj\145.dcm
dicompyler.dicomgui: DEBUG: Reading:E:\ct\lxj\146.dcm
dicompyler: ERROR: Unhandled exception: Traceback (most recent call last):
  File "main.py", line 727, in Run
  File "threading.pyo", line 484, in run
  File "dicompyler\dicomgui.pyo", line 703, in GetPatientData
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-6: ordinal not in range(128)
bastula commented 5 years ago

Are you able to run the latest version from source to test if this has been resolved? If not, do you mind to send an anonymized DICOM file?

shengyusideyouxi commented 3 years ago

I met the same question. So how to deal with it....

bastula commented 3 years ago

@shengyusideyouxi In your post on the dicompyler group, the issue is actually with the folder name:D:\安装包\testdata2014\focus_output\SS.rtp1.12.20080627A.5.dcm If you are able to move the DICOM files to a non-Chinese folder name it will work. The other option is to run the program from source.