||
在ubuntu上安装: conda install -c conda-forge pydicom
读取dicom并可视化
import pydicom, os
import matplotlib.pyplot as plt
path = os.path.join(root, file)
im = pydicom.dcmread(path) # type of data is FileDataset
px = im.pixel_array # convert im to the type of numpy.ndarray
plt.figure()
plt.imshow(px)
plt.show() # do not forget this
关于DICOM预处理的很棒的网站:
https://www.raddq.com/dicom-processing-segmentation-visualization-in-python/
4.
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-27 06:32
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社