pyradiomics
pyradiomics copied to clipboard
[BUG] Segmentation fault (core dumped) in voxel-wise feature extraction
Describe the bug
When I try to run a voxel-wise feature extraction, I get the following error: 'Segmentation fault (core dumped)'.
It works with the same parameters and images when VoxelBased=False
PyRadiomics configuration Bin size = 64 Resampling voxel size 4x4x4 Interpolation method B-spline Radiomics features: GLDM and GLCM
PyRadiomics log file log_file_errorpyradiomics.txt
To Reproduce Execute the code
params = {}
params['binWidth'] = 64
params['resampledPixelSpacing'] = [4,4,4]
params['interpolator'] = 3
extractor = featureextractor.RadiomicsFeatureExtractor(**params)
extractor.disableAllFeatures()
extractor.enableFeatureClassByName('glcm')
voxel_result = extractor.execute(image1, mask, label = labels[0], voxelBased=True)
Expected behavior Voxel-wise images of the different features from GLCM and GLDM matrices.
Version (please complete the following information):
- OS: Linux
- Python version: 3.7
- PyRadiomics version 3.0.1
Can you share a sample of the image/mask for debugging?
Can you share a sample of the image/mask for debugging? pyradiomics_testimages.zip
Hi, I'm encountering this same issue. Is there any update? Thanks!
Same here with any first order feature extraction. It works like a charm with any other features (glcm
, glrlm
, etc.).
PyRadiomics configuration
imageType:
Original: {}
featureClass:
firstorder:
- 'Minimum'
setting:
normalize: true
normalizeScale: 100
binWidth: 25
interpolator: 'sitkBSpline'
resampledPixelSpacing: [1, 1, 1]
correctMask: true
voxelArrayShift: 300
force2D: true
force2Ddimension: 0
voxelSetting:
kernelRadius: 1
maskedKernel: true
voxelBatch: 10000
To reproduce
extractor = featureextractor.RadiomicsFeatureExtractor(PRM_PATH)
features = extractor.execute(IMG, SEG, voxelBased=True)
Output
[1] 61328 segmentation fault python3 main.py
Expected behavior
Working just fine
Version
- OS: MacOS Monterey 12.3.1 (M1 chip)
- Python version: 3.9.12
- PyRadiomics version 3.0.1
⬆️ ⬆️ ⬆️
Hey Guys, When I tried to extract the 3D image shaped (512, 512, 512), some of the images will trigger the segmentation fault error. I thought the error will be triggered only when the voxels of segmentation exceed specific numbers due to memory limit.
So in my case, I added resampling to the image in yaml file and solved the problem.