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.15k stars 499 forks source link

3.0 is slower than 2.0 [FEAT EXTRACTION] #590

Open Qin-BL opened 4 years ago

Qin-BL commented 4 years ago

When I upgraded from 2.1.2 to 3.0, I found that the speed was 25% slower. I calculated the average of five results and compared them

JoostJM commented 4 years ago

@ChineseSuperman, what kind of setup did you use to test this? In version 2.2.0 we refactored the C extensions to work with N-dimensional data and improved the performance for calculating voxel-based features. Do you see this problem for all feature classes? In which part of the code?

Qin-BL commented 4 years ago

@ChineseSuperman,您使用哪种设置进行测试?在2.2.0版中,我们重构了C扩展以处理N维数据,并提高了计算基于体素的特征的性能。您是否对所有要素类都看到此问题?代码的哪一部分?

st_time = time.time() features = extractor.execute(ori_img, voi_img) logger.info('waste_time:%s' % (time.time()-st_time))

The results measured in this way will be 25% slower. python2.7.12--->python3.7.4

JoostJM commented 4 years ago

I can run timing request which indicates time consumed for each function, but for that I would like to know the setup of the extraction. I.e. what kind of input data did you use? How large? Ho many voxels are segmented in the mask? What kind of customization parameters did you apply? Did you use segment-based or voxel-based radiomics?

JoostJM commented 4 years ago

Additionally, did the decrease in time occur between different python or different pyradiomics versions?

Qin-BL commented 4 years ago

另外,时间的减少是否发生在不同的python或不同的pyradiomics版本之间?

1.my setting:settings = { "geometryTolerance": 0.0001, 'normalize': True, 'resampledPixelSpacing': (1, 1, 1) } 2.input data:series which contains hundreds of instances at most 3.version:python2.7.12+radiomics2.1.2, the other one is python3.7.4+radiomics3.0. To get the results, I averaged each one with the same 10 pieces of data.

WingsOfPanda commented 3 years ago

Is there any update on this issue? I am using python3.9 with pyradiomics-3.0.1 and experiencing like 5x slower than python3.6 and pyradiomics-2.1

JoostJM commented 3 years ago

@WingsOfPanda Can you perform a test where you just compare different versions of PyRadiomics (e.g. 2.1 vs 3.0 on python 3.6), and a test where you just compare Python versions (e.g PyRadiomics 3.0 on Python 3.6 and 3.9)?

WingsOfPanda commented 3 years ago

yea sure I'll try tnt. btw I have to keep with 3.0.1 cuz 3.0 requires pywavelets==0.5.2 but scikit-image requires PyWavelets>=1.1.1