如何在不损失质量或改变图像外观的情况下将 DICOM 图像转换为 jpg?

问题描述 投票:0回答:0

我正在尝试将一些 DICOM 图像(设置为肺部窗口)转换为 jpg,但是使用 Pydicom,我得到的图像太白而且图像质量低。

我将 image_paths 列表传递给 .dcm 文件,然后运行:

for n, image in enumerate(image_paths):
    ds = pydicom.dcmread(image)
    pixel_array_numpy = ds.pixel_array
    image = image.replace('.dcm', '.jpg')
    cv2.imwrite(image, pixel_array_numpy)

我怀疑 DICOM 图像被压缩了,我需要解压缩它们 - 但我未能实现 pylibjpeg、pillow 或 GDCM 插件。

如何在不损失图像质量或改变图像外观(在本例中为肺窗)的情况下保存这些 jpg。

python-imaging-library jpeg dicom pydicom
© www.soinside.com 2019 - 2024. All rights reserved.