from medpy.io import load
import SimpleITK
import vtk
image_data, image_header = load('/Users/N01-T2.mha')
print image_data.shape
'객체에는 속성이 없습니다 '그리고 오류는 다음과 같습니다LazyITKModule AnalyzeImageIO '
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/wuzhenglin/anaconda/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 880, in runfile
execfile(filename, namespace)
File "/Users/wuzhenglin/anaconda/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile
builtins.execfile(filename, *where)
File "/Users/wuzhenglin/Python_nice/SAL_LUNG/test.py", line 140, in <module>
changeage()
File "/Users/wuzhenglin/Python_nice/SAL_LUNG/test.py", line 42, in changeage
image_data, image_header = load('/Users/wuzhenglin/Python_nice/SAL_BRAIN/brain_healthy_dataset/Normal001-T2.mha')
File "/Users/wuzhenglin/anaconda/lib/python2.7/site-packages/medpy/io/load.py", line 201, in load
raise err
medpy.core.exceptions.ImageLoadingError: Failes to load image /Users/wuzhenglin/Python_nice/SAL_BRAIN/brain_healthy_dataset/Normal001-T2.mha as
Itk/Vtk MetaImage (.mhd, .mha/.raw). Reason signaled by third-party module:
'LazyITKModule' object has no attribute 'AnalyzeImageIO'
내가 .mha 이미지를 처리하기를 원하지만 그것은 작동하지 않습니다. medpy, itk 및 vtk를 설치했습니다.
Google에서 검색했지만이 문제와 관련된 답변이 없습니다.
.mha는 AnalyzeImageIO가 아닌 MetaImageIO를 호출해야합니다. 아마도 medpy의 이슈 트래커에 관한 이슈로보고하십시오 : https://github.com/loli/medpy/issues –
@ Dženan 고맙습니다. 문제를보고 해 주셨고 파이썬으로 image.mha를 다룰 다른 방법이 있습니까? – JourneyWoo