pyradiomics 运行 extractor.execute 时报错 Indexerror
报错:IndexError:arrays used as indices must be of integer (or boolean) type
解决方法:将emptyGrayLevels的数据类型强制改为int,如下图:
注意:1、在源码中修改;2、修改glszm.py和 gldm.py(不确定是不是这个文件,可能不止一个),反正哪个文件报错就修改哪个 ;
出错原因:似乎是版本BUG,目前版本pyradiomics 3.0,之前用时都没有这个问题,困扰了一整天;
emptyGrayLevels用作整数索引,以从矩阵中删除灰度级。 但是,在linux python 3.6和3.7中,数据类型默认为int64,当尝试将其用作索引时,python将拒绝该数据类型。 因此,将emptyGrayLevels的数据类型设置为int可以防止IndexError。 ---来自谷歌翻译
希望对各位能有所帮助