如何在python中修复pydicom的编码问题 [英] How to fix encoding issues of pydicom in python

查看:214
本文介绍了如何在python中修复pydicom的编码问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是代码:

import dicom

ds = dicom.read_file(FILE_PATH)
print(ds)

错误:

LookupError: unknown encoding: ISO 2022 IR 100

当使用pydicom来查看数据时,出现了以上错误. 根据在此找到了"ISO 2022 IR 100":"latin_1" .

When using pydicom in order to look at data, I got the error above. I found 'ISO 2022 IR 100': 'latin_1' ,according to here.

但是,我没有解决此问题的方法. 您能帮我解决这个错误吗?

However, I didn't get how to fix this problem. Can you help me to solve this error?

推荐答案

如评论中所示,罪魁祸首是pydicom的过时版本.升级到较新的版本可以解决此问题.

As indicated in the comments, the culprit was an out-of-date version of pydicom. Upgrading to a more recent version fixed this issue.

这篇关于如何在python中修复pydicom的编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆