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

GLCM feature extraction warnings #490

Closed
destinybuilt opened this issue Jun 6, 2019 · 10 comments
Closed

GLCM feature extraction warnings #490

destinybuilt opened this issue Jun 6, 2019 · 10 comments
Labels

Comments

@destinybuilt
Copy link

When I use pyradiomics to extract features, I get the following warning:
GLCM is symmetrical, therefore Sum Average = 2 * Joint Average, only 1 needs to be calculated
Should I pay attention to this warning and find a way to solve it?

@JoostJM
Copy link
Collaborator

JoostJM commented Jun 6, 2019

No, it is just a warning to alert you of the fact that the in this case, joint average and sum average are 100% correlated. So no error, just a notification.

@JoostJM JoostJM closed this as completed Jun 6, 2019
@omaghsoudi
Copy link

This warning is useful to know what happens; however, is there anyway to turn it off?
Printing this warning slows down the code!

Thank you!

@fedorov
Copy link
Collaborator

fedorov commented Jul 18, 2019

@omaghsoudi you should be able to control that using the following arguments to the command-line extractor. The message you mention is a warning. By reducing the level of verbosity you should be able to disable printing of the warnings to the console.

$ pyradiomics --help
[...]
Logging:
  Controls the (amount of) logging output to the console and the (optional) log-file.

  --logging-level LEVEL
                        Set capture level for logging
  --log-file FILE       File to append logger output to
  --verbosity [{1,2,3,4,5}], -v [{1,2,3,4,5}]
                        Regulate output to stderr. By default [3], level
                        WARNING and up are printed. By specifying this
                        argument without a value, level INFO [4] is assumed.
                        A higher value results in more verbose output.

@omaghsoudi
Copy link

omaghsoudi commented Jul 18, 2019

Is there any way that I can turn it off when I load the pyradiomics feature discriptors?

I use it as follow:
from radiomics import firstorder, glcm, ngtdm, gldm, glrlm, glszm

I need to turn off verbose for these features families.

Thank you!

@fedorov
Copy link
Collaborator

fedorov commented Jul 18, 2019

If you use pyradiomics programmatically, you should be able to do something like this (see comments in https://github.com/Radiomics/pyradiomics/blob/master/radiomics/base.py#L22-L23):

import logging
# set level for all classes
logger = logging.getLogger("radiomics")
logger.setLevel(logging.ERROR)
# ... or set level for specific class
logger = logging.getLogger("radiomics.glcm")
logger.setLevel(logging.ERROR)

I have not tested this, but I think something like this should work.

@omaghsoudi
Copy link

As you said, it resolved the issue.

Thank you!

@fedorov fedorov changed the title Question about GLCM in pyradiomics GLCM feature extraction warnings Jul 18, 2019
@JoostJM
Copy link
Collaborator

JoostJM commented Aug 12, 2019

Alternatively, you can selectively filter out warnings of a certain type (in this case, DeprecationWarning):

import warnings
warnings.simplefilter('ignore', DeprecationWarning)

@cj-clifton
Copy link

cj-clifton commented Mar 11, 2020

Hi, this solution isn't working for me.

I've also tried:
from radiomics import setVerbosity
setVerbosity(60)

As described here: https://pyradiomics.readthedocs.io/en/latest/_modules/radiomics.html

However I still get the relentless
"GLCM is symmetrical, therefore Sum Average = 2 * Joint Average, only 1 needs to be calculated" log.

Please help!

@AnkushJamthikar
Copy link

I am still getting the messages printed on consol. Is there a way, which prevent the messages to be printed on the consol.

image

@robertoshea
Copy link

robertoshea commented Jun 22, 2023

I have found the following code helpful

logger = radiomics.logging.getLogger("radiomics")
logger.setLevel(radiomics.logging.ERROR)

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

No branches or pull requests

7 participants