ITK ERROR: ITK only supports orthonormal direction cosines. No orthonormal definition found!

问题

ITK ERROR: ITK only supports orthonormal direction cosines. No orthonormal definition found!_第1张图片

Traceback (most recent call last):
  File "", line 1, in 
  File "D:\miniconda3\envs\DL\lib\site-packages\SimpleITK\extra.py", line 355, in ReadImage
    return reader.Execute()
  File "D:\miniconda3\envs\DL\lib\site-packages\SimpleITK\SimpleITK.py", line 8438, in Execute
    return _SimpleITK.ImageFileReader_Execute(self)
RuntimeError: Exception thrown in SimpleITK ImageFileReader_Execute: D:\a\1\sitk-build\ITK\Modules\IO\NIFTI\src\itkNiftiImageIO.cxx:2016:
ITK ERROR: ITK only supports orthonormal direction cosines.  No orthonormal definition found!

但是,
可以看到,用ITK-snap读取时没有问题的
ITK ERROR: ITK only supports orthonormal direction cosines. No orthonormal definition found!_第2张图片

解决方法

itk-snap另存为

不过会发现有一些数据不一样
在这里插入图片描述
ITK ERROR: ITK only supports orthonormal direction cosines. No orthonormal definition found!_第3张图片

ITK ERROR: ITK only supports orthonormal direction cosines. No orthonormal definition found!_第4张图片

nibabel

来个一个大佬的操作

import nibabel as nib
img = nib.load("xxxxx.nii.gz")
img.set_qform(img.get_qform())
img.set_sform(img.get_sform())
nib.save(img, "xxxxx.nii.gz")

ITK ERROR: ITK only supports orthonormal direction cosines. No orthonormal definition found!_第5张图片

降到2.02

虽然不是很推荐这个操作

pip install SimpleITK==2.0.2

参考:
https://blog.csdn.net/qq_27095227/article/details/121045586

你可能感兴趣的:(python,开发语言,SimpleITK,itk)