我在 CentOS 7 上的 Anaconda Spyder 上的 Python 3.7.3 上使用 SimpleITK。我还安装了 Aliza 并尝试将样本卷 /usr/share/aliza/datasets/DICOM/00_MR/PS_0.dcm 读入 Python 进行处理它与 numpy. 但是下面的 Python 代码。
import SimpleITK as sitk
reader = sitk.ImageSeriesReader()
dicom_names = reader.GetGDCMSeriesFileNames( inputSeriesName )
reader.SetFileNames(dicom_names)
image = reader.Execute()
结果是
Traceback (most recent call last):
File "<ipython-input-38-8c1737986203>", line 1, in <module>
image = reader.Execute()
File "/home/peter/anaconda3/lib/python3.7/site-packages/SimpleITK/SimpleITK.py", line 8473, in Execute
return _SimpleITK.ImageSeriesReader_Execute(self)
RuntimeError: Exception thrown in SimpleITK ImageSeriesReader_Execute: ../../Code/IO/src/sitkImageSeriesReader.cxx:163:
sitk::ERROR: The file in the series have unsupported 3 dimensions.
我可以读取一系列 2D 图像,这些图像可以堆叠到一个卷中,但并非所有 DICOM 卷都以这种方式出现