python如何打开.ima文件格式的医学影像(已爬坑,.IMA为西门子CT设备的另一种医学影像文件格式)

.ima格式文件说明

  .ima是西门子ct设备生成的医学图像文件格式之一,和.dicm文件格式一样,.ima文件格式不是特别常见,因此网上的资料不多,找了很久,希望大家能给个赞。

python操作.ima文件相关包安装

  使用python conda 安装pydicom和matplotlib

conda install pydicom
conda install matplotlib

使用python pip 安装pydicom和matplotlib

pip install pydicom
pip install matplotlib

使用python pydicom和matplotlib读取和显示.ima文件结尾的图像文件

  使用python读取和显示.ima文件格式的图像代码

import pydicom
import matplotlib.pyplot as plt

filePath = '../../data/spinal/0001/L-SPINE_LSS_20160309_091629_240000/T1_TSE_SAG_320_0003/T1_TSE_SAG__0001_001.ima'
img = pydicom.read_file(filePath)

plt.imshow(img.pixel_array)
plt.show()

python打开.ima文件效果

python打开和显示.ima文件格式的图像

猜你喜欢

转载自blog.csdn.net/myhes/article/details/106613359
今日推荐