AIM-Harvard / pyradiomics

Open-source python package for the extraction of Radiomics features from 2D and 3D images and binary masks. Support: https://discourse.slicer.org/c/community/radiomics
http://pyradiomics.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.17k stars 497 forks source link

[BUG] Documentation issue with Coarseness #764

Open mattwarkentin opened 2 years ago

mattwarkentin commented 2 years ago

Hi,

According to the documentation for Coarseness (https://pyradiomics.readthedocs.io/en/latest/features.html#radiomics.ngtdm.RadiomicsNGTDM.getCoarsenessFeatureValue), an arbitrary value of 10e6 is returned when the denominator for Coarseness is zero.

However, a value of 1e6 (i.e. 10e5) is actually returned: https://pyradiomics.readthedocs.io/en/latest/_modules/radiomics/ngtdm.html#RadiomicsNGTDM.getCoarsenessFeatureValue

mattwarkentin commented 2 years ago

For my own interest, why return an arbitrarily large value instead of, say, None or some other non-numeric value that would indicate a computational issue? Just wondering how I should handle these situations which have arisen in my data.

JoostJM commented 2 years ago

@mattwarkentin It's not really a computational issue, just an edge case which remains valid. The arbitrary value was suggested in the original source describing the use of NGTDM. An alteranative would by the use np.inf, but this can mess up any analysis (as it can't be normalized)