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.14k stars 492 forks source link

Dynamic binning as default #755

Open TLKline opened 2 years ago

TLKline commented 2 years ago

Based on our understanding, the current default binning utilized in PyRadiomics is dynamically generated based on the minimum and maximum intensity values of the ROI (see lines 56 to 158 of imageoperations.py). However, this approach will exacerbate differences in radiomic features due to even modest differences in masks/ROIs, particularly low gray level emphasis features, as the minimum intensity value could change between the two masks. Is a static binning based on the minimum and maximum of the whole image currently implemented in PyRadiomics? Note that the binning based on the whole image appears to be possible with maskedKernel being set to False for voxel based calculations, see lines 94 to 105 of base.py. However, something similar does not appear to exist for ROI-based calculations. We just wish to confirm this implementation and check what options may be available to do static binning (either based on the whole image range, or possibly as a hard coded range applied the same to an entire set of images).

JoostJM commented 2 years ago

@TLKline this is correct and reflects also the default behavior in the IBSI. There is a fixed bin range when implementing the IBSI binning with a resegmentation range set (see PyRadiomics_IBSIbenchmark in this organization), though this does not work well when enabling filters such as wavelet or LoG.

The reason the minimum intensity is always set to 1 after discretization is that texture features are primarily concerned with contrast, and less so with absolute intensity. To reduce wildly different feature values in e.g. low gray level emphasis etc., this range should be more or less comparable. Note however that I do assume here you're using a fixed bin width. For comments on usage of a fixed bin count (possible, but not recommended) see the PyRadiomics docs.

In fact, there are many texture features that are absolute-gray value ignorant, meaning that if you shift the value of the discretized gray value, the feature value actually does not change. Features like low gray level emphasis etc are the exception here, rather than the rule.