起因是遇到了以下报错:AttributeError: module 'SimpleITK' has no attribute 'ImageSeriesReader'
AttributeError: module 'SimpleITK' has no attribute 'ImageSeriesReader'
发现由于ImageSeriesReader()没有正确运行,导致读入数据为空:
RuntimeError: Exception thrown in SimpleITK ImageSeriesReader_Execute: C:\d\VS14-Win64-pkg\SimpleITK\Code\IO\src\sitkImageSeriesReader.cxx:124:
sitk::ERROR: File names information is empty. Cannot read series.
最终发现是输入路径有中文,SimpleITK.ImageSeriesReader.GetGDCMSeriesFileNames(path)中path不能含有中文,否则无法读取。