How to turn off ImageSeriesReader Warnings? (SimpleITK JAVA)

the ImageSeriesReader are printing Warnings in my console when opening certain series.

i’m using debugOff() method but is not working for this warnings.

Hello,

You can find some information on SimpleITK/ITK’s logging on this documentation page:
https://simpleitk.readthedocs.io/en/master/link_Logging_docs.html

These are warnings and not debug message. The warnings can be global disabled with the ProcessObject::SetGlobalWarningDisplay method.

However, this message does not look like it should be ignored. There is something fundamental wrong with either how you are loading the data set or with the files.

Hi @blowekamp ,

i’ve been receiving these alerts for months and apparently it doesn’t affect any functionality, so I’d like to make the console cleaner. It seems to me to be a problem with the series and not with the software.

opening with radiant dicom viewer shows:

image

I achieved what I wanted with the following code:

SimpleITKJNI.ProcessObject_setGlobalWarningDisplay(false);

Thanks @blowekamp !

Hello @Salu_Ramos,

Disabling warnings globally is a bit of an extreme approach and may not be what you want. It may work for you in this instance and is trivial to implement, but only do it if you are convinced all warnings can be ignored as false positives.

Having said that, I strongly suggest following @blowekamp’s advice about using a logging based approach. This will hide the messages from the user but will make them available to the developer if something goes wrong.

1 Like