Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning when loading .img.gz file #1280

Closed
inqlee0704 opened this issue Dec 23, 2020 · 4 comments
Closed

Warning when loading .img.gz file #1280

inqlee0704 opened this issue Dec 23, 2020 · 4 comments

Comments

@inqlee0704
Copy link

I am trying to load a mask file which has .img.gz format.
The mask file is successfully loaded, but I wonder if I can suppress the warning message created below.
I tried to load python's warning library and suppress it, but it doesn't work since warnings are created from a cxx file.

WARNING: In /Users/runner/work/1/sitk-build/ITK/Modules/IO/NIFTI/src/itkNiftiImageIO.cxx, line 1009
NiftiImageIO (0x7ff6a74b3950): /Users/inkyu/Desktop/SNUH/LungSeg/177_WORST/ZUNU_vida-airtree.img.gz is Analyze file and it's deprecated

@blowekamp
Copy link
Member

Hello, thank you for reporting this. Adding support to expose ITK logging mechanism is a good feature to add. Specifically, enabling use with the Python login module would be good.

@blowekamp
Copy link
Member

All warnings from ITK can be suppressed by the ProcessObject::SetGlobalWarningDisplay proper to false.

@inqlee0704
Copy link
Author

Thank you.
I was able to fix it by
sitk.ProcessObject_SetGlobalWarningDisplay(False)
in python.

@blowekamp
Copy link
Member

Support fo a logging object has also been added to the 2.1 development. This can provide finer grained logging control. Here is an example: https://simpleitk.readthedocs.io/en/master/link_Logging_docs.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants