我在一个文件夹里有几千张dicom图片。我在pydicom上是这样读的
import numpy as np
import dicom
folder = "/images"
imgs = [dicom.read_file(folder + '/' + s) for s in os.listdir(folder)]
然后,我想将所有图像堆叠成一个numpy数组,如下所示:
data = np.stack([i.pixel_array for i in imgs])
但是,图像的大小或不同,因此无法堆叠。
如何添加将所有图像大小调整为1000x1000的步骤?
错误信息:
在1
import pydicom as dicomio
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-102814c2908e> in <module>()
----> 1 import pydicom as dicomio
ImportError: No mo
我正在尝试使用pydicom python库读取CT扫描Dicom文件,但即使安装gdcm和pylibjpeg,我也无法摆脱下面的错误
RuntimeError: The following handlers are available to decode the pixel data however they are missing required dependencies: GDCM (req. ), pylibjpeg (req. )
以下是我的代码
!pip install pylibjpeg pylibjpeg-libjpeg pylibjpeg-openjpeg
!pip ins
我正试图使用freesurfer的NifTi实用工具将大量的DTI西门子DICOM转换为dcm2nii,但在某些文件上失败了,因为它们缺少DiffusionGradientDirection tag (0x19,0x100E),这是生成.bvec和.bval文件所必需的。这并不是说标签没有价值,它们看起来根本不存在。
ds0x19,0x100E回溯(最近一次调用):文件"",第1行,文件"/space/jazz/1/users/gwarner/anaconda/lib/python2.7/site-packages/pydicom-0.9.9-py2.7.egg/di