Two production-path defects the hard-coded phantom tests missed:
- GLCM_OFFSET was zero-initialised when settings are compiled from the
production path, so dx=dy=0 -> every pixel co-occurs with itself ->
CONTRAST=0 for any image. Default GLCM_OFFSET=1 (IBSI delta=1) in
env_features.cpp (plus GLCM_GREYDEPTH/GLCM_NUMANG).
- The MATLAB grey-binning path maps off-ROI background (0) to level 1; the
old zero-skip guard only ran on the IBSI path, so background inside a
concave ROI flooded the co-occurrence matrix and diluted CONTRAST. Skip on
the ORIGINAL intensity (imR==0) in all binning paths (glcm.cpp).
- Soft-NAN guard CORRELATION/INFOMEAS1 for the degenerate single-grey-level
case that a correctly-masked tiny ROI can produce (glcm.cpp/.h, glcm_nontriv.cpp).
Refresh the 25 background-sensitive phantom goldens in test_glcm.h (the
background-insensitive keys are unchanged), add test_glcm_bugs.h with a
production-path offset-default regression guard (registered in test_all.cc),
and add GLCM contrast/background Python tests validated against PyRadiomics/MIRP.
Two production-path defects the hard-coded phantom tests missed:
Refresh the 25 background-sensitive phantom goldens in test_glcm.h (the background-insensitive keys are unchanged), add test_glcm_bugs.h with a production-path offset-default regression guard (registered in test_all.cc), and add GLCM contrast/background Python tests validated against PyRadiomics/MIRP.