question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] ITK ERROR: ITK only supports orthonormal direction cosines. No orthonormal definition found! (SimpleITK >= 2.1.0)

See original GitHub issue

Hello everyone,

Thanks for this great tool 😃

💀 Bug

When using nndet_prep [task] --full-check command, the following error occured:

File "<nnDetection>/nndet/utils/check.py", line 213, in _full_check
	img_itk_seq = [load_sitk(cp) for cp in case_paths]
File "<nnDetection>/nndet/utils/check.py", line 213, in <listcomp>
	img_itk_seq = [load_sitk(cp) for cp in case_paths]
File "<nnDetection>/nndet/io/itk.py", line 107, in load_sitk
	return sitk.ReadImage(str(path), **kwargs)
File "<CondaEnv>/lib/python3.9/site-packages/SimpleITK/extra.py", line 346, in ReadImage
	return reader.Execute()
File "<CondaEnv>/lib/python3.9/site-packages/SimpleITK/SimpleITK.py", line 8015, in Execute
	return _SimpleITK.ImageFileReader_Execute(self)
RuntimeError: Exception thrown in SimpleITK ImageFileReader_Execute: /tmp/SimpleITK-build/ITK/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx:1980:
ITK ERROR: ITK only supports orthonormal direction cosines.  No orthonormal definition found!

This was noticed with the nnUNet framework when mixing different versions of SimpleITK an issue was raised (https://github.com/SimpleITK/SimpleITK/issues/1433).

When using SimpleITK 2.0.2, this error does not occur. This seems to be due to recent changes with ITK when handling Nifti headers (see https://github.com/InsightSoftwareConsortium/ITK/issues/2674 for further details and ongoing conversation).

I would think that freezing SimpleITK to SimpleITK < 2.1.0 would temporarily solve the issue.

Best

Environment

Environment Information:

----- PyTorch Information -----
PyTorch Version: 1.9.0
PyTorch Debug: False
PyTorch CUDA: 10.2
PyTorch Backend cudnn: 7605
PyTorch CUDA Arch List: ['sm_37', 'sm_50', 'sm_60', 'sm_61', 'sm_70', 'sm_75', 'compute_37']
PyTorch Current Device Capability: (7, 0)
PyTorch CUDA available: True

 


----- System Information -----
System NVCC: nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243

 

System Arch List: None
System OMP_NUM_THREADS: 1
System CUDA_HOME is None: True
System CPU Count: 6
Python Version: 3.9.6 (default, Jul 30 2021, 16:35:19)
[GCC 7.5.0]

 


----- nnDetection Information -----
det_num_threads 12
det_data is set True
det_models is set True```

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
malteekjcommented, Nov 22, 2022

I know this is old, but it is still a problem in simpleitk 2.2.0. After searching for a while, I realized the problem can stem from the qform_code and sform_code having different codes (qform is for using quaternion and sform is for using the affine matrix). A solution can be to play around with these and ensure that they conform with the definition of the coordinate system for your image.

A good resource to understand this better: https://brainder.org/2012/09/23/the-nifti-file-format/

1reaction
mibaumgartnercommented, Aug 20, 2021

Hi @alexandreroutier ,

I updated the sitk version inside the requirements file for now.

I’m planning to rerun the preprocessing of the official data sets sometime in the future and will check if the latest version of sitk creates any Issues there. If it goes well I will probably unlock it / bump to the latest version again.

Best, Michael

Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeError - MICCAI 2021: HECKTOR - AIcrowd Forum
When I evaluate the model , I meet an error. But only one patient will create the problem. RuntimeError: Exception thrown in SimpleITK...
Read more >
ITK(in ANTs) occurs error : no orthonormal definition found
The short explanation is that the nifti image has unexpected metadata. Perhaps damaged? Or the writing library is buggy?
Read more >
NVIDIA AIAA error when using auto-segmentation (modle
Hello everyone, Could anyone help me with this error message when using the ... ITK ERROR: ITK only supports orthonormal direction cosines.
Read more >
SimpleITK 2.1.0 Release - Announcements - ITK Discourse
SimpleITK 2.1.0 has been released! The release includes new features, API changes, documentation updates and bug fixes.
Read more >
报错处理ITK only supports orthonormal direction cosines. No ...
报错处理ITK only supports orthonormal direction cosines. No orthonormal definition found ; "d:\PythonProgramme\GenerateDatasetTxt\xx.py", line ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found